//
// Skedar Ruins
//

#include "stagesetup.h"

// Characters
#define CHR_KING1                   0x33
#define CHR_KING_SKEDAR_SPAWNER     0x34
#define CHR_KING_MINISKEDAR_SPAWNER 0x35
#define CHR_ELVIS                   0x36
#define CHR_KING2                   0x3b

// Objects
#define OBJ_PILLAR1          0x01
#define OBJ_PILLAR2          0x02
#define OBJ_PILLAR3          0x03
#define OBJ_BRIDGE           0x05
#define OBJ_TARGETAMP_BOND   0x08
#define OBJ_ALTAR            0x0b
#define OBJ_SPIKE_ML         0x13
#define OBJ_SPIKE_MR         0x14
#define OBJ_SPIKE_BL         0x15
#define OBJ_SPIKE_BR         0x16
#define OBJ_SPIKE_T          0x17
#define OBJ_SPIKE_SHAD_ML    0x19
#define OBJ_SPIKE_SHAD_MR    0x1a
#define OBJ_SPIKE_SHAD_BL    0x1b
#define OBJ_SPIKE_SHAD_BR    0x1c
#define OBJ_SPIKE_SHAD_T     0x1d
#define OBJ_SPIKE_NOSHAD_ML  0x1e
#define OBJ_SPIKE_NOSHAD_MR  0x1f
#define OBJ_SPIKE_NOSHAD_BL  0x20
#define OBJ_SPIKE_NOSHAD_BR  0x21
#define OBJ_SPIKE_NOSHAD_T   0x22
#define OBJ_TARGETAMP_COOP   0x35
#define OBJ_PHOENIX1         0x42
#define OBJ_PHOENIX2         0x43
#define OBJ_REMOTEMINE       0x44
#define OBJ_ALTAR_FALCON     0x47
#define OBJ_ALTAR_DEVASTATOR 0x48
#define OBJ_ALTAR_CALLISTO   0x49
#define OBJ_ALTAR_MAULER     0x4a
#define OBJ_ALTAR_SLAYER     0x4b
#define OBJ_PUZZLEROCK       0x4c
#define OBJ_BUDDYBRIDGE      0x50
#define OBJ_BUDDYBARRICADE   0x51

// Stage flags
#define STAGEFLAG_COOP_THREW_FIRST_BUG          0x00000001
#define STAGEFLAG_COOP_THREW_SECOND_BUG         0x00000002
#define STAGEFLAG_COOP_THREW_THIRD_BUG          0x00000004
#define STAGEFLAG_COOP_BUGS_WASTED              0x00000008
#define STAGEFLAG_BOND_BUGS_WASTED              0x00000010
#define STAGEFLAG_IN_INTRO                      0x00000020
#define STAGEFLAG_IN_OUTRO                      0x00000040
#define STAGEFLAG_AI_BUDDY_EXISTS               0x00000080
#define STAGEFLAG_PILLAR1_MARKED                0x00000100
#define STAGEFLAG_PILLAR2_MARKED                0x00000200
#define STAGEFLAG_PILLAR3_MARKED                0x00000400
#define STAGEFLAG_BUG_WASTED                    0x00000800
#define STAGEFLAG_BRIDGE_EXTENDED               0x00001000
#define STAGEFLAG_TRIGGER_SKEDAR_ARMY           0x00002000
#define STAGEFLAG_ARMY_DEFEATED                 0x00004000
#define STAGEFLAG_CROSSED_RAVINE_WITHOUT_BRIDGE 0x00008000
#define STAGEFLAG_TRIGGER_BRIDGE                0x00010000
#define STAGEFLAG_BOND_THREW_FIRST_BUG          0x00020000
#define STAGEFLAG_BOND_THREW_SECOND_BUG         0x00040000
#define STAGEFLAG_BOND_THREW_THIRD_BUG          0x00080000
#define STAGEFLAG_GRENADES_WASTED               0x00100000
#define STAGEFLAG_ACCESSED_SANCTUM              0x00200000
#define STAGEFLAG_KING_SKEDAR_CLONE_EXISTS      0x00800000
#define STAGEFLAG_SPIKE1_DESTROYED              0x01000000
#define STAGEFLAG_SPIKE2_DESTROYED              0x02000000
#define STAGEFLAG_SPIKE3_DESTROYED              0x04000000
#define STAGEFLAG_SPIKE4_DESTROYED              0x08000000
#define STAGEFLAG_SPIKE5_DESTROYED              0x10000000
#define STAGEFLAG_SPIKES_VULNERABLE             0x20000000
#define STAGEFLAG_SPIKE_DESTROYED               0x40000000
#define STAGEFLAG_KING_MINISKEDAR_CLONE_EXISTS  0x80000000

// AI Lists
#define AILIST_INIT_UNARMED_SKEDAR           0x0401
#define AILIST_UNARMED_SKEDAR                0x0402
#define AILIST_INIT_MINISKEDAR               0x0403
#define AILIST_MINISKEDAR                    0x0404
#define AILIST_PUZZLEROOM_MINISKEDAR_WAITING 0x0405
#define AILIST_MINISKEDAR_SPAWNER            0x0406
#define AILIST_INIT_CLOAKED_SKEDAR           0x0407
#define AILIST_CLOAKED_SKEDAR                0x0408
#define AILIST_REAPER_SLAYER_SKEDAR          0x0409
#define AILIST_INIT_REAPER_SLAYER_SKEDAR     0x040a
#define AILIST_MAULER_SKEDAR                 0x040b
#define AILIST_KING_WAITING                  0x040c
#define AILIST_KING_COMBAT                   0x040d
#define AILIST_KING_SKEDAR_SPAWNER           0x040e
#define AILIST_UPDATE_SPIKE_STAGEFLAGS       0x040f
#define AILIST_INIT_KING_SKEDAR_CLONE        0x0410
#define AILIST_KING_MINISKEDAR_SPAWNER       0x0411
#define AILIST_INIT_KING_MINISKEDAR_CLONE    0x0412
#define AILIST_HIDE                          0x0413
#define AILIST_OUTRO                         0x0414

extern s32 intro[];
extern u32 props[];
extern struct path paths[];
extern struct ailist ailists[];

struct stagesetup setup = {
	NULL,
	NULL,
	NULL,
	intro,
	props,
	paths,
	ailists,
	NULL,
};

u32 props[] = {
	briefing(BRIEFINGTYPE_LOCATION, L_SHO_001)
	briefing(BRIEFINGTYPE_TEXT_PA,  L_SHO_000)
	briefing(BRIEFINGTYPE_TEXT_SA,  L_SHO_002)
	briefing(BRIEFINGTYPE_TEXT_A,   L_SHO_003)

	beginobjective(0, L_SHO_005, (DIFFBIT_A | DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD)) // "Identify temple targets"
		complete_flags(STAGEFLAG_PILLAR1_MARKED)
		complete_flags(STAGEFLAG_PILLAR2_MARKED)
		complete_flags(STAGEFLAG_PILLAR3_MARKED)
		fail_flags(STAGEFLAG_BUG_WASTED)
	endobjective

	beginobjective(1, L_SHO_006, (DIFFBIT_A | DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD)) // "Activate bridge"
		complete_flags(STAGEFLAG_BRIDGE_EXTENDED)
	endobjective

	beginobjective(2, L_SHO_007, (DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD)) // "Gain access to Inner Sanctum"
		complete_flags(STAGEFLAG_ACCESSED_SANCTUM)
	endobjective

	beginobjective(3, L_SHO_008, (DIFFBIT_PA | DIFFBIT_PD)) // "Destroy secret Skedar army"
		complete_flags(STAGEFLAG_ARMY_DEFEATED)
	endobjective

	beginobjective(4, L_SHO_009, (DIFFBIT_A | DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD)) // "Assassinate Skedar leader"
		complete_flags(STAGEFLAG_SPIKE1_DESTROYED)
		complete_flags(STAGEFLAG_SPIKE2_DESTROYED)
		complete_flags(STAGEFLAG_SPIKE3_DESTROYED)
		complete_flags(STAGEFLAG_SPIKE4_DESTROYED)
		complete_flags(STAGEFLAG_SPIKE5_DESTROYED)
		fail_flags(STAGEFLAG_GRENADES_WASTED)
	endobjective

	chr(SPAWNFLAG_BASICGUARD, 0x05, PAD_SHO_00A0, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00d8, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x06, PAD_SHO_00A1, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00d8, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x07, PAD_SHO_00A2, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00d9, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x08, PAD_SHO_00A3, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00d9, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x17, PAD_SHO_00A4, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 15, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, CHRFLAG1_CAN_ATTACKAMOUNTRELOAD, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSKMINIGUN, 0x0017, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_REAPER)
	chr(SPAWNFLAG_BASICGUARD, 0x09, PAD_SHO_00A5, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00da, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x0a, PAD_SHO_00A6, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00da, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x0b, PAD_SHO_00A7, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00db, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x0c, PAD_SHO_00A8, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00db, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x0d, PAD_SHO_00A9, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00dc, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x0e, PAD_SHO_00AA, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00dc, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x0f, PAD_SHO_00AB, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00dd, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x10, PAD_SHO_00AC, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00dd, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x1c, PAD_SHO_00A4, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 15, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, CHRFLAG1_CAN_ATTACKAMOUNTRELOAD, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSKMINIGUN, 0x001c, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_REAPER)
	chr(SPAWNFLAG_BASICGUARD, 0x18, PAD_SHO_00AE, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 50, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, CHRFLAG1_CAN_ATTACKAMOUNTRELOAD, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSKMINIGUN, 0x0018, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_REAPER)
	chr(SPAWNFLAG_BASICGUARD, 0x19, PAD_SHO_00AF, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 50, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, CHRFLAG1_CAN_ATTACKAMOUNTRELOAD, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSKMINIGUN, 0x0019, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_REAPER)
	chr(SPAWNFLAG_BASICGUARD, 0x1a, PAD_SHO_00B0, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 50, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, CHRFLAG1_CAN_ATTACKAMOUNTRELOAD, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSKMINIGUN, 0x001a, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_REAPER)
	chr(SPAWNFLAG_BASICGUARD, 0x11, PAD_SHO_00B1, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00de, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x12, PAD_SHO_00B2, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00de, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x13, PAD_SHO_00B3, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00de, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x14, PAD_SHO_00B4, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00de, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x1b, PAD_SHO_00B5, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, CHRFLAG1_CAN_ATTACKAMOUNTRELOAD, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSKMINIGUN, 0x001b, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_REAPER)
	chr(SPAWNFLAG_BASICGUARD, 0x1d, PAD_SHO_00B6, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, CHRFLAG1_CAN_ATTACKAMOUNTRELOAD, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSKMINIGUN, 0x001d, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_REAPER)
	chr(SPAWNFLAG_BASICGUARD, 0x15, PAD_SHO_00B7, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00df, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x16, PAD_SHO_00B8, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_CLOAKED_SKEDAR, 0x00df, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x1e, PAD_SHO_00B9, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, CHRFLAG1_CAN_ATTACKAMOUNTRELOAD, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSKMINIGUN, 0x001e, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_REAPER)
	chr(SPAWNFLAG_BASICGUARD, 0x1f, PAD_SHO_00BA, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, CHRFLAG1_CAN_ATTACKAMOUNTRELOAD, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSKMINIGUN, 0x001f, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_REAPER)
	chr(0, 0x23, PAD_SHO_00BB, BODY_MINISKEDAR, HEAD_RANDOM, AILIST_MINISKEDAR_SPAWNER, 0x00e0, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(0, 0x24, PAD_SHO_00BC, BODY_MINISKEDAR, HEAD_RANDOM, AILIST_MINISKEDAR_SPAWNER, 0x00e1, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(0, 0x25, PAD_SHO_00BD, BODY_MINISKEDAR, HEAD_RANDOM, AILIST_MINISKEDAR_SPAWNER, 0x00e1, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(0, 0x26, PAD_SHO_00BE, BODY_MINISKEDAR, HEAD_RANDOM, AILIST_PUZZLEROOM_MINISKEDAR_WAITING, -1, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(0, 0x28, PAD_SHO_00BF, BODY_MINISKEDAR, HEAD_RANDOM, AILIST_MINISKEDAR_SPAWNER, 0x00e2, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(0, 0x29, PAD_SHO_00C0, BODY_MINISKEDAR, HEAD_RANDOM, AILIST_MINISKEDAR_SPAWNER, 0x00e3, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(0, 0x2a, PAD_SHO_00C2, BODY_MINISKEDAR, HEAD_RANDOM, AILIST_MINISKEDAR_SPAWNER, 0x00e4, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x20, PAD_SHO_00C3, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 30, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 2, 0, 5, 0)
	weapon(0x0100, MODEL_CHRSKROCKET, 0x0020, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SLAYER)
	chr(SPAWNFLAG_BASICGUARD, 0x21, PAD_SHO_00C4, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 30, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 2, 0, 5, 0)
	weapon(0x0100, MODEL_CHRSKROCKET, 0x0021, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SLAYER)
	chr(SPAWNFLAG_BASICGUARD, 0x22, PAD_SHO_00C5, BODY_SKEDAR, HEAD_RANDOM, AILIST_INIT_REAPER_SLAYER_SKEDAR, -1, -1, 1000, 30, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 2, 0, 10, 0)
	weapon(0x0100, MODEL_CHRSKMINIGUN, 0x0022, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_REAPER)
	chr(SPAWNFLAG_IGNORECOLLISION, 0x2c, PAD_SHO_00C6, BODY_SKEDAR, HEAD_RANDOM, AILIST_MAULER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_HOLD_POSITION, CHRFLAG1_IGNORECOVER, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRMAULER, 0x002c, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_MAULER)
	chr(SPAWNFLAG_IGNORECOLLISION, 0x2d, PAD_SHO_00C7, BODY_SKEDAR, HEAD_RANDOM, AILIST_MAULER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_HOLD_POSITION, CHRFLAG1_IGNORECOVER, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRMAULER, 0x002d, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_MAULER)
	chr(SPAWNFLAG_IGNORECOLLISION, 0x2e, PAD_SHO_00C8, BODY_SKEDAR, HEAD_RANDOM, AILIST_MAULER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_HOLD_POSITION, CHRFLAG1_IGNORECOVER, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRMAULER, 0x002e, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_MAULER)
	chr(SPAWNFLAG_IGNORECOLLISION, 0x2f, PAD_SHO_00C9, BODY_SKEDAR, HEAD_RANDOM, AILIST_MAULER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_HOLD_POSITION, CHRFLAG1_IGNORECOVER, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRMAULER, 0x002f, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_MAULER)
	chr(SPAWNFLAG_IGNORECOLLISION, 0x30, PAD_SHO_00CA, BODY_SKEDAR, HEAD_RANDOM, AILIST_MAULER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_HOLD_POSITION, CHRFLAG1_IGNORECOVER, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRMAULER, 0x0030, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_MAULER)
	chr(SPAWNFLAG_IGNORECOLLISION, 0x31, PAD_SHO_00CB, BODY_SKEDAR, HEAD_RANDOM, AILIST_MAULER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_HOLD_POSITION, CHRFLAG1_IGNORECOVER, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRMAULER, 0x0031, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_MAULER)
	chr(SPAWNFLAG_IGNORECOLLISION, 0x32, PAD_SHO_00CC, BODY_SKEDAR, HEAD_RANDOM, AILIST_MAULER_SKEDAR, -1, -1, 1000, 9, CHRFLAG0_HOLD_POSITION, CHRFLAG1_IGNORECOVER, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRMAULER, 0x0032, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_MAULER)
	chr(0, 0x33, PAD_SHO_00CD, BODY_SKEDARKING, HEAD_RANDOM, AILIST_HIDE, -1, -1, 1000, 9, CHRFLAG0_HOLD_POSITION, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_KINGSCEPTRE, 0x0033, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_ROCKETLAUNCHER_34)
	chr(0, 0x34, PAD_SHO_00CE, BODY_SKEDAR, HEAD_RANDOM, AILIST_KING_SKEDAR_SPAWNER, -1, -1, 1000, 9, CHRFLAG0_GP1, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	ammocrate(0x0100, MODEL_CHRUZI, 0x0034, OBJFLAG_ASSIGNEDTOCHR, 0, 0, 1000, AMMOTYPE_FARSIGHT)
	chr(0, 0x35, PAD_SHO_00CF, BODY_MINISKEDAR, HEAD_RANDOM, AILIST_KING_MINISKEDAR_SPAWNER, -1, -1, 1000, 9, CHRFLAG0_GP1, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BLUESIGHT, 0x36, PAD_SHO_00D9, BODY_ELVISWAISTCOAT, HEAD_ELVIS, AILIST_HIDE, -1, -1, 1000, 200, CHRFLAG0_SKIPSAFETYCHECKS, CHRFLAG1_AIVSAI_ADVANTAGED | CHRFLAG1_NOOP_00200000, TEAM_ALLY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_FIXEDHEIGHT, 0x37, PAD_SHO_000F, BODY_SKEDAR, HEAD_RANDOM, AILIST_HIDE, 0x00d8, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_FIXEDHEIGHT, 0x38, PAD_SHO_0010, BODY_SKEDAR, HEAD_RANDOM, AILIST_HIDE, 0x00d8, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_FIXEDHEIGHT, 0x39, PAD_SHO_0011, BODY_SKEDAR, HEAD_RANDOM, AILIST_HIDE, 0x00d8, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_FIXEDHEIGHT, 0x3a, PAD_SHO_0012, BODY_SKEDAR, HEAD_RANDOM, AILIST_HIDE, 0x00d8, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_FIXEDHEIGHT, 0x3b, PAD_SHO_0018, BODY_SKEDARKING, HEAD_RANDOM, GAILIST_IDLE, 0x00d8, -1, 1000, 9, CHRFLAG0_SKIPSAFETYCHECKS, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_KINGSCEPTRE, 0x003b, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_NONE)
	conditional_scenery(1, 0, 2)
	debris(0x0100, MODEL_SKCREV_UNEXP1, PAD_SHO_00E5, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, OBJFLAG3_INFRARED, 1000)
#if VERSION >= VERSION_NTSC_1_0
	debris(0x0100, MODEL_SKCREV_EXP1, PAD_SHO_00E6, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
#else
	debris(0x0100, MODEL_SKCREV_EXP1, PAD_SHO_00E6, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
#endif
	tag(0x44, 1)
	mine(0x0100, MODEL_CHRPROXIMITYMINE, PAD_SHO_00E6, OBJFLAG_00000002, 0, 0, 1000, WEAPON_PROXIMITYMINE)
	conditional_scenery(1, 0, 2)
	door(0x0100, MODEL_SKTNL_UNEXP1, PAD_SHO_00E7, OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_PATHBLOCKER | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_DEACTIVATED, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS | OBJFLAG2_AICANNOTUSE, OBJFLAG3_INFRARED, 1000, 0x00000000, 0x00010000, 0x03e80000, 0x03e80000, 0x00010000, 0, DOORTYPE_SLIDING, 0x00000080, 0x00000001, 0x00010000, 0x00000000, 0x00000000)
	stdobject(0x0100, MODEL_SKTNL_EXP1, PAD_SHO_00E8, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	tag(0x4d, -2)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_PILLARLEFT, PAD_SHO_013D, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF, 0, 1000)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_PILLARLEFT, PAD_SHO_013E, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF, 0, 1000)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_PILLARLEFT, PAD_SHO_013F, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF, 0, 1000)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_PILLARLEFT, PAD_SHO_0140, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF, 0, 1000)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_PILLARRIGHT, PAD_SHO_0141, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF, 0, 1000)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_PILLARRIGHT, PAD_SHO_0142, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF, 0, 1000)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_PILLARRIGHT, PAD_SHO_0143, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF, 0, 1000)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_PILLARRIGHT, PAD_SHO_0144, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF, 0, 1000)
	tag(0x19, 5)
	tag(0x1a, 5)
	tag(0x1b, 5)
	tag(0x1c, 5)
	tag(0x1d, 5)
	stdobject(0x0100, MODEL_SK_FL_SHAD_ML, PAD_SHO_014B, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	stdobject(0x0100, MODEL_SK_FL_SHAD_MR, PAD_SHO_014C, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	stdobject(0x0100, MODEL_SK_FL_SHAD_BL, PAD_SHO_014D, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	stdobject(0x0100, MODEL_SK_FL_SHAD_BR, PAD_SHO_014E, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	stdobject(0x0100, MODEL_SK_FL_SHAD_T, PAD_SHO_014A, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	tag(0x1e, 5)
	tag(0x1f, 5)
	tag(0x20, 5)
	tag(0x21, 5)
	tag(0x22, 5)
	stdobject(0x0100, MODEL_SK_FL_NOSHAD_ML, PAD_SHO_014B, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	stdobject(0x0100, MODEL_SK_FL_NOSHAD_MR, PAD_SHO_014C, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	stdobject(0x0100, MODEL_SK_FL_NOSHAD_BL, PAD_SHO_014D, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	stdobject(0x0100, MODEL_SK_FL_NOSHAD_BR, PAD_SHO_014E, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	stdobject(0x0100, MODEL_SK_FL_NOSHAD_T, PAD_SHO_014A, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	tag(0x01, 3)
	tag(0x2a, 2)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_TEMPLECOLUMN4, PAD_SHO_0111, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_DONTPAUSE | OBJFLAG2_BULLETPROOF | OBJFLAG2_DEBRIS_80000000, 0, 1000)
	tag(0x02, 3)
	tag(0x2b, 2)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_TEMPLECOLUMN2, PAD_SHO_010A, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_DONTPAUSE | OBJFLAG2_BULLETPROOF | OBJFLAG2_DEBRIS_80000000, 0, 1000)
	tag(0x41, -1)
	tag(0x03, 3)
	tag(0x2c, 2)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_TEMPLECOLUMN3, PAD_SHO_010B, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_DONTPAUSE | OBJFLAG2_BULLETPROOF | OBJFLAG2_DEBRIS_80000000, 0, 1000)
	tag(0x2d, 2)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_TEMPLECOLUMN2, PAD_SHO_010C, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_DONTPAUSE | OBJFLAG2_BULLETPROOF | OBJFLAG2_DEBRIS_80000000, 0, 1000)
	tag(0x2e, 2)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_TEMPLECOLUMN3, PAD_SHO_010D, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_DONTPAUSE | OBJFLAG2_BULLETPROOF | OBJFLAG2_DEBRIS_80000000, 0, 1000)
	tag(0x2f, 5)
	tag(0x30, 5)
	tag(0x31, 5)
	tag(0x32, 5)
	tag(0x33, 5)
	stdobject(0x0019, MODEL_CHRREMOTEMINE, PAD_SHO_00D5, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_BOUNCEIFSHOT | OBJFLAG_01000000, OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE, 0, 1000)
	stdobject(0x0019, MODEL_CHRREMOTEMINE, PAD_SHO_010A, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_BOUNCEIFSHOT | OBJFLAG_01000000, OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE, 0, 1000)
	stdobject(0x0019, MODEL_CHRREMOTEMINE, PAD_SHO_010B, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_BOUNCEIFSHOT | OBJFLAG_01000000, OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE, 0, 1000)
	stdobject(0x0019, MODEL_CHRREMOTEMINE, PAD_SHO_010C, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_BOUNCEIFSHOT | OBJFLAG_01000000, OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE, 0, 1000)
	stdobject(0x0019, MODEL_CHRREMOTEMINE, PAD_SHO_010D, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_BOUNCEIFSHOT | OBJFLAG_01000000, OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE, 0, 1000)
	tag(0x27, -3)
	tag(0x28, -3)
	tag(0x29, -3)
	tag(0x3e, 1)
	stdobject(0x0100, MODEL_SK_SUNSHAD1, PAD_SHO_014F, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	tag(0x3d, 1)
	stdobject(0x0100, MODEL_SK_SUNSHAD2, PAD_SHO_0150, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	tag(0x4e, 2)
	tag(0x4f, 2)
	stdobject(0x0100, MODEL_SK_SUNNOSHAD1, PAD_SHO_014F, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	stdobject(0x0100, MODEL_SK_SUNNOSHAD2, PAD_SHO_0150, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_INVISIBLE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00EB, OBJFLAG_DEACTIVATED, 0, OBJFLAG3_DOOR_STICKY, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0x00000001, 0x00000400)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00EC, OBJFLAG_DEACTIVATED, 0, OBJFLAG3_DOOR_STICKY, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0xffffffff, 0x00000400)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00ED, OBJFLAG_DEACTIVATED, 0, OBJFLAG3_DOOR_STICKY, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0x00000001, 0x00000400)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00EE, OBJFLAG_DEACTIVATED, 0, OBJFLAG3_DOOR_STICKY, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0xffffffff, 0x00000400)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00EF, OBJFLAG_DEACTIVATED, 0, OBJFLAG3_DOOR_STICKY, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0x00000001, 0x00000400)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00F0, OBJFLAG_DEACTIVATED, 0, OBJFLAG3_DOOR_STICKY, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0xffffffff, 0x00000400)
	tag(0x09, 2)
	tag(0x0a, 2)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00F1, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000002, 0x0000012c, 0x00000000, 0x00000001, 0x00000400)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00F2, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000002, 0x0000012c, 0x00000000, 0xffffffff, 0x00000400)
	tag(0x0d, 2)
	tag(0x0e, 2)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00F3, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT | OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0x00000001, 0x00000400)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00F4, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDBACK | OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0xffffffff, 0x00000400)
	tag(0x45, 2)
	tag(0x46, 2)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00F5, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDBACK | OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000080, 0x0000012c, 0x00000000, 0x00000001, 0x00000400)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00F6, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT | OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000080, 0x0000012c, 0x00000000, 0xffffffff, 0x00000400)
	tag(0x0f, 2)
	tag(0x10, 2)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00F7, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDBACK | OBJFLAG2_AICANNOTUSE, OBJFLAG3_DOOR_STICKY, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0x00000001, 0x00000400)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00F8, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT | OBJFLAG2_AICANNOTUSE, OBJFLAG3_DOOR_STICKY, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0xffffffff, 0x00000400)
	tag(0x11, 2)
	tag(0x12, 2)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00F9, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT | OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000080, 0x0000012c, 0x00000000, 0x00000001, 0x00000400)
	door(0x0100, MODEL_SK_DOOR1, PAD_SHO_00FA, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDBACK | OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000e666, 0x00010000, 0x00001999, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000080, 0x0000012c, 0x00000000, 0xffffffff, 0x00000400)
	tag(0x0c, 1)
	fan(0x0100, MODEL_SK_UNDER_GENERATOR, PAD_SHO_0126, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000, 0x00000444, 0x00000002, 0x01000000)
	fan(0x0100, MODEL_SK_UNDER_TRANS, PAD_SHO_0127, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000, 0x00000444, 0x00000002, 0x01000000)
	fan(0x0100, MODEL_SK_UNDER_TRANS, PAD_SHO_0128, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000, 0x00000444, 0x00000002, 0x01000000)
	tag(0x4c, 1)
#if VERSION >= VERSION_NTSC_1_0
	stdobject(0x00e6, MODEL_SKPUZZLEOBJECT, PAD_SHO_012C, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE | OBJFLAG_01000000, OBJFLAG2_NOFALL | OBJFLAG2_IMMUNETOGUNFIRE, OBJFLAG3_PUSHABLE, 1000)
#else
	stdobject(0x00e6, MODEL_SKPUZZLEOBJECT, PAD_SHO_012C, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, OBJFLAG2_NOFALL | OBJFLAG2_IMMUNETOGUNFIRE, OBJFLAG3_PUSHABLE | OBJFLAG3_LONGPUSHRANGE, 1000)
#endif
	tag(0x05, 1)
	lift(0x0100, MODEL_SKEDARBRIDGE, PAD_SHO_0135, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x0135, 0x0134, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000471c, 0x00a6aaaa, 0x00000000)
	tag(0x08, 1)
	stdobject(0x0100, MODEL_TARGETAMP, PAD_SHO_0001, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_COLLECTABLE | OBJFLAG_BOUNCEIFSHOT | OBJFLAG_01000000, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	rename_object(-1, WEAPON_TARGETAMPLIFIER, L_SHO_020, L_SHO_021, L_SHO_022, L_SHO_023, L_SHO_024) // "Obtain Target Amplifier."
	tag(0x35, 1)
	stdobject(0x0100, MODEL_TARGETAMP, PAD_SHO_0001, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_COLLECTABLE | OBJFLAG_BOUNCEIFSHOT | OBJFLAG_01000000, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	rename_object(-1, WEAPON_TARGETAMPLIFIER, L_SHO_020, L_SHO_021, L_SHO_022, L_SHO_023, L_SHO_024) // "Obtain Target Amplifier."
	tag(0x0b, 1)
	multimonitor(0x0019, MODEL_COMHUB, PAD_SHO_0137, OBJFLAG_00000002 | OBJFLAG_INVINCIBLE | OBJFLAG_FORCENOBOUNCE, 0, OBJFLAG3_INTERACTABLE, 1000, 3, 3, 3, 0)
	tag(0x13, 1)
	stdobject(0x0100, MODEL_SK_PLINTH_ML, PAD_SHO_0146, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_COLLECTABLE | OBJFLAG_01000000, 0, 0, 3000)
	tag(0x14, 1)
	stdobject(0x0100, MODEL_SK_PLINTH_MR, PAD_SHO_0147, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_COLLECTABLE | OBJFLAG_01000000, 0, 0, 3000)
	tag(0x15, 1)
	stdobject(0x0100, MODEL_SK_PLINTH_BL, PAD_SHO_0149, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_COLLECTABLE | OBJFLAG_01000000, 0, 0, 3000)
	tag(0x16, 1)
	stdobject(0x0100, MODEL_SK_PLINTH_BR, PAD_SHO_0148, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_COLLECTABLE | OBJFLAG_01000000, 0, 0, 3000)
	tag(0x17, 1)
	stdobject(0x0100, MODEL_SK_PLINTH_T, PAD_SHO_0145, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_COLLECTABLE | OBJFLAG_01000000, 0, 0, 3000)
	stdobject(0x0100, MODEL_A51_CRATE1, PAD_SHO_012D, OBJFLAG_FALL | OBJFLAG_00000100, 0, 0, 1000)
	weapon(0x0100, MODEL_CHRMAULER, -1, OBJFLAG_INSIDEANOTHEROBJ, 0, 0, WEAPON_MAULER)
	stdobject(0x0100, MODEL_A51_CRATE2, PAD_SHO_012E, OBJFLAG_FALL | OBJFLAG_00000100, 0, 0, 1000)
	weapon(0x0100, MODEL_CHRMAULER, -1, OBJFLAG_INSIDEANOTHEROBJ, 0, 0, WEAPON_MAULER)
	stdobject(0x0100, MODEL_A51_CRATE3, PAD_SHO_012F, OBJFLAG_FALL | OBJFLAG_00000100, 0, 0, 1000)
	weapon(0x0100, MODEL_CHRMAULER, -1, OBJFLAG_INSIDEANOTHEROBJ, 0, 0, WEAPON_MAULER)
	stdobject(0x0100, MODEL_A51_CRATE1, PAD_SHO_0130, OBJFLAG_FALL | OBJFLAG_00000100, 0, 0, 1000)
	weapon(0x0100, MODEL_CHRMAULER, -1, OBJFLAG_INSIDEANOTHEROBJ, 0, 0, WEAPON_MAULER)
	tag(0x23, 1)
	stdobject(0x0019, MODEL_RUBBLE1, -1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	tag(0x24, 1)
	stdobject(0x0019, MODEL_RUBBLE2, -1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	tag(0x25, 1)
	stdobject(0x0019, MODEL_RUBBLE3, -1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	tag(0x26, 1)
	stdobject(0x0019, MODEL_RUBBLE4, -1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	tag(0x37, 1)
	stdobject(0x0019, MODEL_SK_JONRUBBLE3, -1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	tag(0x38, 1)
	stdobject(0x0019, MODEL_SK_JONRUBBLE4, -1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	tag(0x39, 1)
	stdobject(0x0019, MODEL_SK_JONRUBBLE5, -1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	tag(0x3a, 1)
	stdobject(0x0019, MODEL_SK_JONRUBBLE6, -1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	tag(0x3b, 1)
	stdobject(0x0019, MODEL_SK_JONRUBBLE3, -1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	tag(0x3c, 1)
	stdobject(0x0019, MODEL_RUBBLE3, -1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_TEMPLECOLUMN2, PAD_SHO_010E, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_DEBRIS_80000000, 0, 1000)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_TEMPLECOLUMN2, PAD_SHO_010F, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_DEBRIS_80000000, 0, 1000)
	conditional_scenery(1, 0, 0)
	debris(0x0100, MODEL_SK_TEMPLECOLUMN2, PAD_SHO_0110, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_DEBRIS_80000000, 0, 1000)
	tag(0x36, 1)
	stdobject(0x0100, MODEL_SK_SHUTTLE, -1, OBJFLAG_FALL | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	door(0x0100, MODEL_SK_CRYOPOD1_BOT, PAD_SHO_00FC, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_TOP, PAD_SHO_00FB, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_BOT, PAD_SHO_00FD, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_TOP, PAD_SHO_00FE, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_BOT, PAD_SHO_0100, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_TOP, PAD_SHO_00FF, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_BOT, PAD_SHO_0101, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_TOP, PAD_SHO_0102, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_BOT, PAD_SHO_0104, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_TOP, PAD_SHO_0103, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_BOT, PAD_SHO_0106, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_TOP, PAD_SHO_0105, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_BOT, PAD_SHO_0107, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00001100)
	door(0x0100, MODEL_SK_CRYOPOD1_TOP, PAD_SHO_0108, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000eb68, 0x0000eb68, 0x0001aaaa, 0x00002aaa, 0x00002aaa, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00001100)
	tag(0x47, 1)
	weapon(0x0100, MODEL_CHRFALCON2SCOPE, PAD_SHO_00D6, OBJFLAG_UNCOLLECTABLE, OBJFLAG2_INVISIBLE, 0, WEAPON_FALCON2_SCOPE)
	tag(0x48, 1)
	weapon(0x0100, MODEL_CHRDEVASTATOR, PAD_SHO_00D6, OBJFLAG_UNCOLLECTABLE, OBJFLAG2_INVISIBLE, 0, WEAPON_DEVASTATOR)
	tag(0x49, 1)
	weapon(0x0100, MODEL_CHRMAIANSMG, PAD_SHO_00D6, OBJFLAG_UNCOLLECTABLE, OBJFLAG2_INVISIBLE, 0, WEAPON_CALLISTO)
	tag(0x4a, 1)
	weapon(0x0100, MODEL_CHRMAULER, PAD_SHO_00D6, OBJFLAG_UNCOLLECTABLE, OBJFLAG2_INVISIBLE, 0, WEAPON_MAULER)
	tag(0x4b, 1)
	weapon(0x0100, MODEL_CHRSKROCKET, PAD_SHO_00D6, OBJFLAG_UNCOLLECTABLE, OBJFLAG2_INVISIBLE, 0, WEAPON_SLAYER)
	tag(0x50, 2)
	tag(0x51, 2)
	stdobject(0x0100, MODEL_BUDDYBRIDGE, PAD_SHO_00EA, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	stdobject(0x0100, MODEL_SK_TEMPLECOLUMN4, PAD_SHO_0131, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	tag(0x3f, 1)
	shield(0x0100, MODEL_CHRSHIELD, PAD_SHO_0151, OBJFLAG_FALL, OBJFLAG2_EXCLUDE_SA | OBJFLAG2_EXCLUDE_PA | OBJFLAG2_EXCLUDE_PD, 0, 1000)
	tag(0x40, 1)
	shield(0x0100, MODEL_CHRSHIELD, PAD_SHO_00BA, OBJFLAG_FALL, OBJFLAG2_EXCLUDE_PA | OBJFLAG2_EXCLUDE_PD, 0, 1000)
	tag(0x42, 2)
	tag(0x43, 2)
	weapon(0x0100, MODEL_CHRMAIANPISTOL, PAD_SHO_0032, OBJFLAG_FALL | OBJFLAG_UNCOLLECTABLE, OBJFLAG2_INVISIBLE, 0, WEAPON_PHOENIX)
	weapon(0x0100, MODEL_CHRMAIANPISTOL, PAD_SHO_0032, OBJFLAG_FALL | OBJFLAG_UNCOLLECTABLE, OBJFLAG2_INVISIBLE, 0, WEAPON_PHOENIX)
	link_guns(-1, -2)
	pad_effect(PADEFFECT_SPARKS, 0x0112)
	pad_effect(PADEFFECT_SPARKS, 0x0117)
	pad_effect(PADEFFECT_SPARKS, 0x0113)
	pad_effect(PADEFFECT_SPARKS, 0x0114)
	pad_effect(PADEFFECT_SPARKS, 0x0115)
	pad_effect(PADEFFECT_SPARKS, 0x0116)
	pad_effect(PADEFFECT_SPARKS, 0x0118)
	pad_effect(PADEFFECT_SPARKS, 0x0119)
	pad_effect(PADEFFECT_SPARKS, 0x011a)
	pad_effect(PADEFFECT_SPARKS, 0x011b)
	pad_effect(PADEFFECT_SPARKS, 0x011c)
	pad_effect(PADEFFECT_SPARKS, 0x011d)
	pad_effect(PADEFFECT_SPARKS, 0x011e)
	pad_effect(PADEFFECT_SPARKS, 0x011f)
	pad_effect(PADEFFECT_SPARKS, 0x0120)
	pad_effect(PADEFFECT_SPARKS, 0x0121)
	pad_effect(PADEFFECT_SPARKS, 0x0122)
	pad_effect(PADEFFECT_SPARKS, 0x0123)
	pad_effect(PADEFFECT_SPARKS, 0x0124)
	pad_effect(PADEFFECT_SPARKS, 0x0125)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x0025)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x008c)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x0028)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x0029)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x002a)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x0023)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x0027)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x0026)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x0006)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x00d9)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x00a3)
	pad_effect(PADEFFECT_OUTROSMOKE, 0x000c)
	endprops
};

s32 intro[] = {
	outfit(OUTFIT_DEFAULT)
	intro_weapon(WEAPON_FALCON2_SCOPE, -1)
	ammo(AMMOTYPE_PISTOL, 200)
	intro_weapon(WEAPON_CALLISTO, -1)
	ammo(AMMOTYPE_SMG, 300)
	ammo(AMMOTYPE_BUG, 3)
	intro_weapon(WEAPON_DEVASTATOR, -1)
	ammo(AMMOTYPE_DEVASTATOR, 4)
	intro_weapon(WEAPON_IRSCANNER, -1)
	intro_weapon(WEAPON_RTRACKER, -1)
	spawn(PAD_SHO_0000)
	endintro
};

u8 func0401_init_unarmed_skedar[] = {
	set_accuracy(0)
	set_reaction_speed(75)
	set_chr_maxdamage(CHR_SELF, 40)
	add_health_or_armor(160)
	set_recovery_speed(0)
	set_shield(0)
	set_self_chrflag(CHRCFLAG_FORCEAUTOAIM)
	set_ailist(CHR_SELF, AILIST_UNARMED_SKEDAR)
	endlist
};

u8 func0402_unarmed_skedar[] = {
	set_shotlist(AILIST_UNARMED_SKEDAR)
	set_action(MA_NORMAL, TRUE)
	if_chr_dead(CHR_SELF, /*goto*/ 0x2d)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x2d)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x2d)
	goto_next(0x06)

	// Dying
	label(0x2d)
	set_shotlist(GAILIST_IDLE)
	yield
	restart_timer

	beginloop(0x11)
		if_timer_gt(30, /*goto*/ 0x2d)
	endloop(0x11)

	label(0x2d)
	set_ailist(CHR_SELF, GAILIST_IDLE)
#define LABEL_HANDLE_PHOENIX_AREA 0x5a
#define LABEL_HANDLE_WALL_AREA    0x5b

	// Alive
	label(0x06)
	set_action(MA_NORMAL, TRUE)
	stop_chr
	if_self_flag_bankx_eq(CHRFLAG0_GP1, FALSE, BANK_0, /*goto*/ 0x03)
	set_action(MA_TRACKING, TRUE)
	try_run_to_target(/*goto*/ 0x03)

	beginloop(0x03)
		if_chr_in_room(CHR_SELF, 0x00, 0x003b, /*goto*/ LABEL_HANDLE_PHOENIX_AREA)
		if_chr_in_room(CHR_SELF, 0x00, 0x0041, /*goto*/ LABEL_HANDLE_WALL_AREA)
		if_self_flag_bankx_eq(CHRFLAG0_AIVSAI, FALSE, BANK_0, /*goto*/ 0x2e)
		if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2d)
		label(0x2e)
		set_target_chr(CHR_BOND)
		if_los_to_target(/*goto*/ 0x2d)
		set_target_chr(CHR_COOP)
		if_los_to_target(/*goto*/ 0x2d)
		if_self_flag_bankx_eq(CHRFLAG0_GP1, FALSE, BANK_0, /*goto*/ 0x2e)
		if_just_injured(CHR_SELF, /*goto*/ 0x2d)

		label(0x2e)
		call_rng
		if_rand_gt(1, /*goto*/ 0x06)
		say_quip(CHR_BOND, QUIP_GRENADE1, 0xff, 0x05, 0xff, BANK_0, 0x00, 0x00)
		label(0x06)
	endloop(0x03)

	// Injured or detected enemy
	label(0x2d)
	label(0xd9)
	yield
	if_chr_in_room(CHR_SELF, 0x00, 0x003b, /*goto*/ LABEL_HANDLE_PHOENIX_AREA)
	if_chr_in_room(CHR_SELF, 0x00, 0x0041, /*goto*/ LABEL_HANDLE_WALL_AREA)
	if_self_flag_bankx_eq(CHRFLAG0_AIVSAI, FALSE, BANK_0, /*goto*/ 0x2e)
	if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2e)
	label(0x2e)
	set_chr_cloaked(CHR_SELF, FALSE, TRUE)
	say_quip(CHR_BOND, QUIP_ATTACK2, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	if_distance_to_target_lt(150, /*goto*/ 0x2f)
	label(0x54)
	if_num_times_shot_lt(1, /*goto*/ 0x2d)
	goto_next(0x06)

	label(0x2d)
	label(0x2d)
	restart_timer
	set_action(MA_WAITING, TRUE)
	say_quip(CHR_BOND, QUIP_GRENADE1, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	try_walk_to_target(/*goto*/ 0x08)

	beginloop(0x08)
		if_chr_in_room(CHR_SELF, 0x00, 0x003b, /*goto*/ LABEL_HANDLE_PHOENIX_AREA)
		if_chr_in_room(CHR_SELF, 0x00, 0x0041, /*goto*/ LABEL_HANDLE_WALL_AREA)
		if_timer_gt(120, /*goto*/ 0x09)
	endloop(0x08)

	label(0x09)
	label(0x0a)
	if_chr_not_talking(CHR_SELF, /*goto*/ 0x2d)
	goto_next(0x2d)

	label(0x06)
	say_quip(CHR_BOND, QUIP_ATTACK2, 0x20, 0x00, 0xff, BANK_0, 0x00, 0x00)
	label(0x2d)
	restart_timer
	set_action(MA_TRACKING, TRUE)
	try_run_to_target(/*goto*/ 0x0b)

	beginloop(0x0b)
		if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_CLOAKED, /*goto*/ 0x10)
		if_chr_in_room(CHR_SELF, 0x00, 0x003b, /*goto*/ LABEL_HANDLE_PHOENIX_AREA)
		if_chr_in_room(CHR_SELF, 0x00, 0x0041, /*goto*/ LABEL_HANDLE_WALL_AREA)
		if_chr_death_animation_finished(CHR_TARGET, /*goto*/ 0x10)
		if_chr_dead(CHR_TARGET, /*goto*/ 0x10)
		if_chr_knockedout(CHR_TARGET, /*goto*/ 0x10)
		if_target_moving_away(/*goto*/ 0x2d)
		if_distance_to_target_lt(150, /*goto*/ 0x2f)
		label(0x2d)
		if_distance_to_target_lt(50, /*goto*/ 0x2f)
		if_timer_gt(30, /*goto*/ 0x06)
	endloop(0x0b)

	label(0x06)
	goto_first(0x0a)

	label(0x2f)
	restart_timer
	dprint 'F','A','C','E',' ','T','A','R','G','E','T','\n',0,
	if_target_in_fov_left(10, /*goto*/ 0x06)
	if_target_out_of_fov_left(246, /*goto*/ 0x06)
	stop_chr
	set_action(MA_FACING, TRUE)
	try_face_entity(ATTACKFLAG_AIMATTARGET, 1, /*goto*/ 0x0c)

	beginloop(0x0c)
		if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_CLOAKED, /*goto*/ 0x10)
		if_chr_in_room(CHR_SELF, 0x00, 0x003b, /*goto*/ LABEL_HANDLE_PHOENIX_AREA)
		if_chr_in_room(CHR_SELF, 0x00, 0x0041, /*goto*/ LABEL_HANDLE_WALL_AREA)
		if_chr_death_animation_finished(CHR_TARGET, /*goto*/ 0x10)
		if_chr_dead(CHR_TARGET, /*goto*/ 0x10)
		if_chr_knockedout(CHR_TARGET, /*goto*/ 0x10)
		if_target_in_fov_left(10, /*goto*/ 0x06)
		if_target_out_of_fov_left(246, /*goto*/ 0x06)
		if_timer_gt(60, /*goto*/ 0x06)
	endloop(0x0c)

	label(0x06)
	set_action(MA_PUNCHING, TRUE)
	try_punch_or_kick(/*goto*/ 0x31)
	goto_first(0xd9)

	// Punching or kicking
	label(0x31)

	beginloop(0x30)
		if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_CLOAKED, /*goto*/ 0x10)
		if_chr_in_room(CHR_SELF, 0x00, 0x003b, /*goto*/ LABEL_HANDLE_PHOENIX_AREA)
		if_chr_in_room(CHR_SELF, 0x00, 0x0041, /*goto*/ LABEL_HANDLE_WALL_AREA)
		if_chr_death_animation_finished(CHR_TARGET, /*goto*/ 0x10)
		if_chr_dead(CHR_TARGET, /*goto*/ 0x10)
		if_chr_knockedout(CHR_TARGET, /*goto*/ 0x10)
		if_chr_stopped(/*goto*/ 0x06)
	endloop(0x30)

	// Finished attack
	label(0x06)
	if_chr_death_animation_finished(CHR_TARGET, /*goto*/ 0x10)
	if_chr_dead(CHR_TARGET, /*goto*/ 0x10)
	if_chr_knockedout(CHR_TARGET, /*goto*/ 0x10)
	goto_first(0xd9)

	// Killed target
	label(0x10)
	stop_chr
	unset_self_flag_bankx(CHRFLAG0_GP1, BANK_0)
	goto_first(0x03)

	// At ledge near Phoenix
	label(LABEL_HANDLE_PHOENIX_AREA)
	stop_chr
	set_chr_cloaked(CHR_SELF, TRUE, TRUE)
	restart_timer
	run_to_pad(PAD_SHO_0018)

	beginloop(0x5c)
		if_chr_stopped(/*goto*/ 0x2d)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0020, /*goto*/ 0x2d) // at T junction near Phoenix
	endloop(0x5c)

	label(0x2d)
	set_self_flag_bankx(CHRFLAG0_GP1, BANK_0)
	goto_first(0x03)

	// At ledge prior to grenadable wall
	label(LABEL_HANDLE_WALL_AREA)
	stop_chr
	set_chr_cloaked(CHR_SELF, TRUE, TRUE)
	restart_timer
	run_to_pad(PAD_SHO_003C)

	beginloop(0x5c)
		if_chr_stopped(/*goto*/ 0x2d)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0045, /*goto*/ 0x2d) // at weak wall
	endloop(0x5c)

	label(0x2d)
	set_self_flag_bankx(CHRFLAG0_GP1, BANK_0)
	goto_first(0x03)

	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0405_puzzleroom_miniskedar_waiting[] = {
	stop_chr

	beginloop(0x03)
		if_self_flag_bankx_eq(CHRFLAG0_AIVSAI, FALSE, BANK_0, /*goto*/ 0x2e)
		if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2d)

		label(0x2e)
		set_target_chr(CHR_BOND)
		if_los_to_target(/*goto*/ 0x2d)
		set_target_chr(CHR_COOP)
		if_los_to_target(/*goto*/ 0x2d)
		if_just_injured(CHR_SELF, /*goto*/ 0x2d)
	endloop(0x03)

	// Detected player
	label(0x2d)
	set_ailist(CHR_SELF, AILIST_INIT_MINISKEDAR)
	endlist
};

u8 func0403_init_miniskedar[] = {
	set_self_chrflag(CHRCFLAG_FORCEAUTOAIM)
	set_accuracy(0)
	set_reaction_speed(75)
	set_chr_maxdamage(CHR_SELF, 40)
	add_health_or_armor(0)
	set_recovery_speed(0)
	set_shield(0)
	set_self_chrflag(CHRCFLAG_RUNFASTER)
	set_ailist(CHR_SELF, AILIST_MINISKEDAR)
	endlist
};

u8 func0404_miniskedar[] = {
	set_shotlist(AILIST_MINISKEDAR)
	if_chr_dead(CHR_SELF, /*goto*/ 0x2d)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x2d)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x2d)
	goto_next(0x06)

	// Dying
	label(0x2d)
	yield
	restart_timer

	beginloop(0x11)
		if_timer_gt(30, /*goto*/ 0x2d)
	endloop(0x11)

	label(0x2d)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Alive
	label(0x06)
	label(0x03)
	yield
	if_self_flag_bankx_eq(CHRFLAG0_AIVSAI, FALSE, BANK_0, /*goto*/ 0x2e)
	if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2d)

	label(0x2e)
	if_los_to_target(/*goto*/ 0x2d)
	if_just_injured(CHR_SELF, /*goto*/ 0x2d)

	// Healthy
	call_rng
	say_quip(CHR_BOND, QUIP_RETREAT2, 0xff, 0x05, 0xff, BANK_0, 0x00, 0x00)
	label(0x06)
	label(0x06)
	goto_next(0x54)

	// Injured or detected enemy
	label(0x2d)
	set_self_flag_bankx(CHRFLAG0_GP1, BANK_0)
	if_distance_to_target_lt(400, /*goto*/ 0x2f)

	label(0x54)
	restart_timer
	label(0x09)
	restart_timer
	if_chr_not_talking(CHR_SELF, /*goto*/ 0x2d)
	goto_next(0x06)

	label(0x2d)
	label(0x06)
	try_run_to_target(/*goto*/ 0x0b)

	beginloop(0x0b)
		if_self_flag_bankx_eq(CHRFLAG0_AIVSAI, FALSE, BANK_0, /*goto*/ 0x2e)
		if_enemy_distance_lt_and_los(2540, /*goto*/ 0x2d)
		label(0x2e)
		if_los_to_target(/*goto*/ 0x2d)
		goto_next(0x06)

		label(0x2d)
		if_distance_to_target_lt(400, /*goto*/ 0x2f)
		label(0x06)
		if_timer_gt(60, /*goto*/ 0x06)
	endloop(0x0b)

	label(0x06)
	goto_first(0x09)

	label(0x2f)
	restart_timer
	dprint 'F','A','C','E',' ','T','A','R','G','E','T','\n',0,
	stop_chr
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x0c)

	beginloop(0x0c)
		if_timer_gt(30, /*goto*/ 0x06)
	endloop(0x0c)

	label(0x2d)
	if_target_in_fov_left(10, /*goto*/ 0x06)
	if_target_out_of_fov_left(246, /*goto*/ 0x06)
	goto_first(0x0c)

	label(0x06)
	if_distance_to_target_lt(200, /*goto*/ 0x2e)
	miniskedar_try_pounce(0x04, 0x000e, /*goto*/ 0x30)
	goto_first(0x03)

	beginloop(0x30)
		if_chr_stopped(/*goto*/ 0x2d)
	endloop(0x30)

	label(0x2d)
	restart_timer
	if_chr_injured_target(CHR_SELF, /*goto*/ 0x2d)
	goto_next(0x06)

	label(0x2d)
	label(0x2e)
	retreat(GOPOSFLAG_RUN, 1)

	beginloop(0x0d)
		if_timer_gt(120, /*goto*/ 0x06)
	endloop(0x0d)

	label(0x06)
	goto_first(0x03)

	endlist
};

/**
 * Spawn a clone and remove self. This function seems unnecessary.
 */
u8 func0407_init_cloaked_skedar[] = {
	set_self_chrflag(CHRCFLAG_CLONEABLE)
	set_self_chrflag(CHRCFLAG_HIDDEN)
	set_self_chrflag(CHRCFLAG_NEVERSLEEP)
	set_chr_hiddenflag(CHR_SELF, CHRHFLAG_CLOAKED)

	beginloop(0x04)
		// Wait until clone dead - which it would be immediately?
		chr_toggle_p1p2(CHR_SELF)
		label(0x4f)
		if_chr_death_animation_finished(CHR_CLONE, /*goto*/ 0x4f)
		reloop(0x04)

		// Spawn clone
		label(0x4f)
		try_spawn_clone2(CHR_SELF, AILIST_CLOAKED_SKEDAR, SPAWNFLAG_ALLOWONSCREEN | SPAWNFLAG_HIDDEN, /*goto*/ 0x2d)
		reloop(0x04)

		// Remove self
		label(0x2d)
		remove_chr(CHR_SELF)
		set_ailist(CHR_SELF, GAILIST_IDLE)
		yield
	endloop(0x04)

	endlist
};

u8 func0408_cloaked_skedar[] = {
	set_chr_team(CHR_SELF, TEAM_ENEMY)
	rebuild_teams
	rebuild_squadrons
	set_self_chrflag(CHRCFLAG_NEVERSLEEP)
	set_self_chrflag(CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_SELF, CHRHFLAG_CLOAKED)
	set_chr_hiddenflag(CHR_SELF, CHRHFLAG_BASICGUARD)
	restart_timer

	beginloop(0x08)
		if_objective_complete(4, /*goto*/ 0x0e)

		// King is alive
		chr_toggle_p1p2(CHR_SELF)
		if_chr_distance_to_pad_lt(CHR_P1P2, 300, PAD_PRESET, /*goto*/ 0x2d)

		// 1 in 256 chance of making skedar roar sound
		call_rng
		if_rand_gt(1, /*goto*/ 0x06)
		say_quip(CHR_BOND, QUIP_GRENADE1, 0xff, 0x05, 0xff, BANK_0, 0x00, 0x00)
		label(0x06)
	endloop(0x08)

	// Player went close to cloaked skedar
	label(0x2d)
	unset_self_chrflag(CHRCFLAG_HIDDEN)
	set_ailist(CHR_SELF, AILIST_INIT_UNARMED_SKEDAR)

	// King is dead
	label(0x0e)
	remove_chr(CHR_SELF)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

/**
 * Spawns up to 3 miniskedar clones, one at a time.
 */
u8 func0404_miniskedar_spawner[] = {
	set_self_chrflag(CHRCFLAG_CLONEABLE)
	set_self_chrflag(CHRCFLAG_HIDDEN)
	set_self_chrflag(CHRCFLAG_NEVERSLEEP)
	set_morale(0)

	// Wait until player near trigger pad
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_distance_to_pad_lt(CHR_P1P2, 300, PAD_PRESET, /*goto*/ 0x4f)
		endloop(0x04)

		label(0x4f)
		if_morale_lt(3, /*goto*/ 0x06)
		goto_next(0x2e)

		label(0x06)
		if_chr_death_animation_finished(CHR_CLONE, /*goto*/ 0x4f)
		reloop(0x04)

		label(0x4f)
		try_spawn_clone2(CHR_SELF, AILIST_INIT_MINISKEDAR, SPAWNFLAG_ALLOWONSCREEN, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		add_morale(1)
		label(0x2e)
		yield
	endloop(0x04)

	endlist
};

u8 unregistered_function3[] = {
	camera_movement(ANIM_CUT_SHO_BETA_CAM)
	yield
	set_chr_hiddenflag(0x00, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_BETA_NOCHR, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x00, 4)

	beginloop(0x08)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x06)

		label(0x2d)
	endloop(0x08)

	label(0x06)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1001_objectives_failed_msg[] = {
	yield
	give_object_to_chr(OBJ_TARGETAMP_BOND, CHR_BOND)
	give_object_to_chr(OBJ_TARGETAMP_COOP, CHR_COOP)
	if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x2d)
	set_ailist(CHR_SELF, GAILIST_SHOW_OBJ_FAILED_MSG)

	label(0x2d)
	disable_object(OBJ_TARGETAMP_COOP)
	set_ailist(CHR_SELF, GAILIST_SHOW_OBJ_FAILED_MSG)
	endlist
};

u8 func1400_setup_counterop[] = {
	yield
	set_chr_team(CHR_ANTI, TEAM_ENEMY)
	set_ailist(CHR_SELF, GAILIST_REBUILD_GROUPS)
	endlist
};

u8 func1003_remove_random_skedar[] = {
	#define remove_random(chr1, chr2) \
		call_rng \
		if_rand_gt(128, /*goto*/ 0x2d) \
		remove_chr(chr1) \
		goto_next(0x06) \
		label(0x2d) \
		remove_chr(chr2) \
		label(0x06)

	remove_random(0x05, 0x06)
	remove_random(0x07, 0x08)
	remove_random(0x0b, 0x0c)
	remove_random(0x0f, 0x10)
	remove_random(0x11, 0x12)
	remove_random(0x13, 0x14)

	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func101a_pointless[] = {
	beginloop(0x04)
		if_chr_death_animation_finished(CHR_KING1, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func100c_check_army_defeated[] = {
#if VERSION >= VERSION_NTSC_1_0
	yield
#endif

	beginloop(0x04)
		if_chr_death_animation_finished(0x2c, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		if_chr_death_animation_finished(0x2d, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		if_chr_death_animation_finished(0x2e, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		if_chr_death_animation_finished(0x2f, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		if_chr_death_animation_finished(0x30, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		if_chr_death_animation_finished(0x31, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		if_chr_death_animation_finished(0x32, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	show_hudmsg(CHR_BOND, L_SHO_029) // "Skedar secret army has been defeated."
	set_stage_flag(STAGEFLAG_ARMY_DEFEATED)

	beginloop(0x91)
		if_objective_complete(0, /*goto*/ 0x2d)
	endloop(0x91)

	label(0x2d)
	unset_object_flag2(0x45, OBJFLAG2_LOCKEDFRONT)
	unset_object_flag2(0x46, OBJFLAG2_LOCKEDBACK)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1005_5e0c[] = {
	yield

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
#if VERSION >= VERSION_PAL_BETA
		if_object_distance_to_pad_lt(OBJ_PUZZLEROCK, 50, PAD_SHO_00D4, /*goto*/ 0x41)
#else
		if_object_distance_to_pad_lt(OBJ_PUZZLEROCK, 50, PAD_SHO_00D4, /*goto*/ 0x2d)
#endif
		if_chr_distance_to_pad_lt(CHR_P1P2, 50, PAD_SHO_00D4, /*goto*/ 0x2d)
		if_chr_in_room(CHR_P1P2, 0x00, 0x005f, /*goto*/ 0x2e)
		unset_stage_flag(STAGEFLAG_TRIGGER_BRIDGE)
	endloop(0x04)

	// Crossed bridge without using puzzle piece,
	// or one player crossed then another moved the piece off the pad
	label(0x2e)
	set_stage_flag(STAGEFLAG_CROSSED_RAVINE_WITHOUT_BRIDGE)
	set_stage_flag(STAGEFLAG_TRIGGER_BRIDGE)

#if VERSION >= VERSION_PAL_BETA
	label(0x41)
	if_num_human_players_lt(2, /*goto*/ 0x2d)
	unset_object_flag3(OBJ_PUZZLEROCK, OBJFLAG3_PUSHABLE)
#endif

	// Pad pressed, or follow through from above
	label(0x2d)
	if_stage_flag_eq(STAGEFLAG_TRIGGER_BRIDGE, TRUE, /*goto*/ 0x2d)
	mute_channel(CHANNEL_5)
	assign_sound(SFX_0436, CHANNEL_5)
	set_object_sound_playing(CHANNEL_5, OBJ_PUZZLEROCK, TRUE)

	// Wait for a condition that would cause the bridge to retract
	label(0x2d)
	restart_timer

	beginloop(0x91)
		if_stage_flag_eq(STAGEFLAG_CROSSED_RAVINE_WITHOUT_BRIDGE, TRUE, /*goto*/ 0x2d)
		if_timer_gt(60, /*goto*/ 0x2e)
		label(0x2d)
		if_timer_lt(20, /*goto*/ 0x06)
		if_stage_flag_eq(STAGEFLAG_CROSSED_RAVINE_WITHOUT_BRIDGE, TRUE, /*goto*/ 0x93)
		if_object_distance_to_pad_lt(OBJ_PUZZLEROCK, 50, PAD_SHO_00D4, /*goto*/ 0x06)
		if_chr_distance_to_pad_lt(CHR_P1P2, 50, PAD_SHO_00D4, /*goto*/ 0x06)
		goto_next(0x2e)

		label(0x06)
		reloop(0x91)

		label(0x93)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0057, /*goto*/ 0x06) // start side
	endloop(0x91)

	// Player crossed bridge without using switch, then crossed back
	label(0x06)
	unset_stage_flag(STAGEFLAG_CROSSED_RAVINE_WITHOUT_BRIDGE)
	unset_stage_flag(STAGEFLAG_TRIGGER_BRIDGE)
	goto_first(0x04)

	// Switch activated and bridge extended for 1 second
	label(0x2e)
	if_object_distance_to_pad_lt(OBJ_PUZZLEROCK, 50, PAD_SHO_00D4, /*goto*/ 0x2d)
	if_chr_distance_to_pad_lt(CHR_P1P2, 50, PAD_SHO_00D4, /*goto*/ 0x2d)

	// Switch no longer pressed
	mute_channel(CHANNEL_5)
	assign_sound(SFX_0437, CHANNEL_5)
	set_object_sound_playing(CHANNEL_5, OBJ_PUZZLEROCK, TRUE)
	goto_first(0x04)

	// Switch still pressed
	label(0x2d)
	set_stage_flag(STAGEFLAG_TRIGGER_BRIDGE)
	goto_first(0x04)

	endlist
};

u8 func1006_bridge[] = {
	beginloop(0x04)
		if_stage_flag_eq(STAGEFLAG_TRIGGER_BRIDGE, TRUE, /*goto*/ 0x2d)
		set_object_flag(OBJ_BRIDGE, OBJFLAG_DEACTIVATED)
	endloop(0x04)

	label(0x2d)
	unset_object_flag(OBJ_BRIDGE, OBJFLAG_DEACTIVATED)
	mute_channel(CHANNEL_4)
	assign_sound(SFX_DOOR_8020, CHANNEL_4)
	play_repeating_sound_from_object(CHANNEL_4, OBJ_BRIDGE, 1, 1200, 1600)
	yield

	beginloop(0x08)
		if_lift_stationary(OBJ_BRIDGE, /*goto*/ 0x06)
	endloop(0x08)

	label(0x06)
	mute_channel(CHANNEL_4)
	assign_sound(SFX_DOOR_8027, CHANNEL_4)
	set_object_sound_playing(CHANNEL_4, OBJ_BRIDGE, TRUE)
	set_object_flag(OBJ_BRIDGE, OBJFLAG_DEACTIVATED)
	set_stage_flag(STAGEFLAG_BRIDGE_EXTENDED)

	beginloop(0x09)
		if_stage_flag_eq(STAGEFLAG_TRIGGER_BRIDGE, FALSE, /*goto*/ 0x2d)
	endloop(0x09)

	label(0x2d)

	beginloop(0x91)
		if_sound_finished(CHANNEL_4, /*goto*/ 0x2d)
	endloop(0x91)

	label(0x2d)
	unset_object_flag(OBJ_BRIDGE, OBJFLAG_DEACTIVATED)
	mute_channel(CHANNEL_4)
	assign_sound(SFX_DOOR_8020, CHANNEL_4)
	play_repeating_sound_from_object(CHANNEL_4, OBJ_BRIDGE, 1, 1200, 1600)
	yield

	beginloop(0x0b)
		if_lift_stationary(OBJ_BRIDGE, /*goto*/ 0x06)
	endloop(0x0b)

	label(0x06)
	unset_stage_flag(STAGEFLAG_BRIDGE_EXTENDED)
	set_object_flag(OBJ_BRIDGE, OBJFLAG_DEACTIVATED)
	mute_channel(CHANNEL_4)
	assign_sound(SFX_DOOR_8027, CHANNEL_4)
	set_object_sound_playing(CHANNEL_4, OBJ_BRIDGE, TRUE)
	goto_first(0x04)

	endlist
};

u8 func1007_bug_throws_bond[] = {
	beginloop(0x03)
		if_stage_flag_eq(STAGEFLAG_BOND_THREW_FIRST_BUG, FALSE, /*goto*/ 0x55)
		if_stage_flag_eq(STAGEFLAG_BOND_THREW_SECOND_BUG, FALSE, /*goto*/ 0x56)
		if_stage_flag_eq(STAGEFLAG_BOND_THREW_THIRD_BUG, FALSE, /*goto*/ 0x57)

		label(0x55)
		dprint 'C','H','E','C','K',' ','1','\n',0,
		if_ammo_quantity_lt(CHR_BOND, AMMOTYPE_BUG, 3, /*goto*/ 0x2d)
	endloop(0x03)

	// Threw first
	label(0x2d)
	dprint 'F','I','R','E',' ','1','\n',0,
	set_stage_flag(STAGEFLAG_BOND_THREW_FIRST_BUG)
	goto_next(0x0e)

	// Check for second
	label(0x56)
	dprint 'C','H','E','C','K',' ','2','\n',0,
	label(0x2d)
	if_ammo_quantity_lt(CHR_BOND, AMMOTYPE_BUG, 2, /*goto*/ 0x2d)
	goto_first(0x03)

	label(0x2d)
	set_stage_flag(STAGEFLAG_BOND_THREW_SECOND_BUG)
	goto_next(0x0e)

	// Check for third
	label(0x57)
	dprint 'C','H','E','C','K',' ','3','\n',0,
	if_ammo_quantity_lt(CHR_BOND, AMMOTYPE_BUG, 1, /*goto*/ 0x2d)
	goto_first(0x03)

	label(0x2d)
	set_stage_flag(STAGEFLAG_BOND_THREW_THIRD_BUG)
	goto_next(0x0e)

	beginloop(0x0e)
		if_weapon_thrown(WEAPON_TARGETAMPLIFIER, /*goto*/ 0x06)
	endloop(0x0e)

	label(0x06)
	restart_timer

	beginloop(0x08)
		dprint 'A','T',' ','R','E','S','T','\n',0,
		if_stage_flag_eq(STAGEFLAG_PILLAR1_MARKED, TRUE, /*goto*/ 0x2d)
		if_weapon_thrown_on_object(WEAPON_TARGETAMPLIFIER, OBJ_PILLAR1, /*goto*/ 0x09)
		label(0x2d)
		if_stage_flag_eq(STAGEFLAG_PILLAR2_MARKED, TRUE, /*goto*/ 0x2d)
		if_weapon_thrown_on_object(WEAPON_TARGETAMPLIFIER, OBJ_PILLAR2, /*goto*/ 0x0b)
		label(0x2d)
		if_stage_flag_eq(STAGEFLAG_PILLAR3_MARKED, TRUE, /*goto*/ 0x2d)
		if_weapon_thrown_on_object(WEAPON_TARGETAMPLIFIER, OBJ_PILLAR3, /*goto*/ 0x0c)
		label(0x2d)
		if_timer_gt(120, /*goto*/ 0x0d)
	endloop(0x08)

	label(0x09)
	dprint '1',' ','P','L','A','C','E','D','\n',0,
	if_stage_flag_eq(STAGEFLAG_PILLAR1_MARKED, TRUE, /*goto*/ 0x0d)
	set_stage_flag(STAGEFLAG_PILLAR1_MARKED)
	show_hudmsg(CHR_BOND, L_SHO_025) // "Target Amplifier placed correctly."
	if_ammo_quantity_lt(CHR_BOND, AMMOTYPE_BUG, 1, /*goto*/ 0x0d)
	goto_first(0x03)

	label(0x0b)
	dprint '2',' ','P','L','A','C','E','D','\n',0,
	if_stage_flag_eq(STAGEFLAG_PILLAR2_MARKED, TRUE, /*goto*/ 0x0d)
	set_stage_flag(STAGEFLAG_PILLAR2_MARKED)
	show_hudmsg(CHR_BOND, L_SHO_025) // "Target Amplifier placed correctly."
	if_ammo_quantity_lt(CHR_BOND, AMMOTYPE_BUG, 1, /*goto*/ 0x0d)
	goto_first(0x03)

	label(0x0c)
	dprint '3',' ','P','L','A','C','E','D','\n',0,
	if_stage_flag_eq(STAGEFLAG_PILLAR3_MARKED, TRUE, /*goto*/ 0x0d)
	set_stage_flag(STAGEFLAG_PILLAR3_MARKED)
	show_hudmsg(CHR_BOND, L_SHO_025) // "Target Amplifier placed correctly."
	if_ammo_quantity_lt(CHR_BOND, AMMOTYPE_BUG, 1, /*goto*/ 0x0d)
	goto_first(0x03)

	label(0x0d)
	dprint 'P','L','L','A','C','E','D',' ','W','R','O','N','G','\n',0,
	if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x2e)
	if_stage_flag_eq(STAGEFLAG_COOP_BUGS_WASTED, TRUE, /*goto*/ 0x2d)
	goto_next(0x0f)

	label(0x2d)
	if_ammo_quantity_lt(CHR_BOND, AMMOTYPE_BUG, 1, /*goto*/ 0x2e)
	goto_next(0x0f)

	label(0x2e)
	if_stage_flag_eq(STAGEFLAG_PILLAR1_MARKED, FALSE, /*goto*/ 0x06)
	if_stage_flag_eq(STAGEFLAG_PILLAR2_MARKED, FALSE, /*goto*/ 0x06)
	if_stage_flag_eq(STAGEFLAG_PILLAR3_MARKED, FALSE, /*goto*/ 0x06)
	goto_next(0x2d)

	label(0x06)
	set_stage_flag(STAGEFLAG_BOND_BUGS_WASTED)
	if_stage_flag_eq(STAGEFLAG_COOP_BUGS_WASTED, FALSE, /*goto*/ 0x0f)
	set_stage_flag(STAGEFLAG_BUG_WASTED)
	show_hudmsg(CHR_BOND, L_SHO_026) // "Target Amplifier placed incorrectly."
	label(0x2d)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(0x0f)
	goto_first(0x03)

	endlist
};

u8 func101b_bug_throws_coop[] = {
	if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x2d)
	goto_next(0x03)

	label(0x2d)
	set_stage_flag(STAGEFLAG_COOP_BUGS_WASTED)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	beginloop(0x03)
		if_stage_flag_eq(STAGEFLAG_COOP_THREW_FIRST_BUG, FALSE, /*goto*/ 0x55)
		if_stage_flag_eq(STAGEFLAG_COOP_THREW_SECOND_BUG, FALSE, /*goto*/ 0x56)
		if_stage_flag_eq(STAGEFLAG_COOP_THREW_THIRD_BUG, FALSE, /*goto*/ 0x57)

		label(0x55)
		dprint 'C','O','O','P',' ','C','H','E','C','K',' ','1','\n',0,
		if_ammo_quantity_lt(CHR_COOP, AMMOTYPE_BUG, 3, /*goto*/ 0x2d)
	endloop(0x03)

	label(0x2d)
	dprint 'C','O','O','P',' ','F','I','R','E',' ','1','\n',0,
	set_stage_flag(STAGEFLAG_COOP_THREW_FIRST_BUG)
	goto_next(0x0e)

	label(0x56)
	dprint 'C','O','O','P',' ','C','H','E','C','K',' ','2','\n',0,
	label(0x2d)
	if_ammo_quantity_lt(CHR_COOP, AMMOTYPE_BUG, 2, /*goto*/ 0x2d)
	goto_first(0x03)

	label(0x2d)
	set_stage_flag(STAGEFLAG_COOP_THREW_SECOND_BUG)
	goto_next(0x0e)

	label(0x57)
	dprint 'C','O','O','P',' ','C','H','E','C','K',' ','3','\n',0,
	if_ammo_quantity_lt(CHR_COOP, AMMOTYPE_BUG, 1, /*goto*/ 0x2d)
	goto_first(0x03)

	label(0x2d)
	set_stage_flag(STAGEFLAG_COOP_THREW_THIRD_BUG)
	goto_next(0x0e)

	beginloop(0x0e)
		if_weapon_thrown(WEAPON_TARGETAMPLIFIER, /*goto*/ 0x06)
	endloop(0x0e)

	label(0x06)
	restart_timer

	beginloop(0x08)
		dprint 'C','O','O','P',' ','A','T',' ','R','E','S','T','\n',0,
		if_stage_flag_eq(STAGEFLAG_PILLAR1_MARKED, TRUE, /*goto*/ 0x2d)
		if_weapon_thrown_on_object(WEAPON_TARGETAMPLIFIER, 0x01, /*goto*/ 0x09)
		label(0x2d)
		if_stage_flag_eq(STAGEFLAG_PILLAR2_MARKED, TRUE, /*goto*/ 0x2d)
		if_weapon_thrown_on_object(WEAPON_TARGETAMPLIFIER, 0x02, /*goto*/ 0x0b)
		label(0x2d)
		if_stage_flag_eq(STAGEFLAG_PILLAR3_MARKED, TRUE, /*goto*/ 0x2d)
		if_weapon_thrown_on_object(WEAPON_TARGETAMPLIFIER, 0x03, /*goto*/ 0x0c)
		label(0x2d)
		if_timer_gt(120, /*goto*/ 0x0d)
	endloop(0x08)

	label(0x09)
	dprint 'C','O','O','P',' ','1',' ','P','L','A','C','E','D','\n',0,
	unset_object_flag3(OBJ_PILLAR1, OBJFLAG3_RTRACKED_YELLOW)
	if_stage_flag_eq(STAGEFLAG_PILLAR1_MARKED, TRUE, /*goto*/ 0x0d)
	set_stage_flag(STAGEFLAG_PILLAR1_MARKED)
	show_hudmsg(CHR_COOP, L_SHO_025) // "Target Amplifier placed correctly."
	if_ammo_quantity_lt(CHR_COOP, AMMOTYPE_BUG, 1, /*goto*/ 0x0d)
	goto_first(0x03)

	label(0x0b)
	dprint 'C','O','O','P',' ','2',' ','P','L','A','C','E','D','\n',0,
	unset_object_flag3(OBJ_PILLAR2, OBJFLAG3_RTRACKED_YELLOW)
	if_stage_flag_eq(STAGEFLAG_PILLAR2_MARKED, TRUE, /*goto*/ 0x0d)
	set_stage_flag(STAGEFLAG_PILLAR2_MARKED)
	show_hudmsg(CHR_COOP, L_SHO_025) // "Target Amplifier placed correctly."
	if_ammo_quantity_lt(CHR_COOP, AMMOTYPE_BUG, 1, /*goto*/ 0x0d)
	goto_first(0x03)

	label(0x0c)
	dprint 'C','O','O','P',' ','3',' ','P','L','A','C','E','D','\n',0,
	unset_object_flag3(OBJ_PILLAR3, OBJFLAG3_RTRACKED_YELLOW)
	if_stage_flag_eq(STAGEFLAG_PILLAR3_MARKED, TRUE, /*goto*/ 0x0d)
	set_stage_flag(STAGEFLAG_PILLAR3_MARKED)
	show_hudmsg(CHR_COOP, L_SHO_025) // "Target Amplifier placed correctly."
	if_ammo_quantity_lt(CHR_COOP, AMMOTYPE_BUG, 1, /*goto*/ 0x0d)
	goto_first(0x03)

	label(0x0d)
	dprint 'C','O','O','P',' ','P','L','L','A','C','E','D',' ','W','R','O','N','G','\n',0,
	if_ammo_quantity_lt(CHR_BOND, AMMOTYPE_BUG, 1, /*goto*/ 0x2d)
	goto_next(0x0f)

	label(0x2d)
	if_ammo_quantity_lt(CHR_COOP, AMMOTYPE_BUG, 1, /*goto*/ 0x2d)
	goto_next(0x0f)

	label(0x2d)
	if_stage_flag_eq(STAGEFLAG_PILLAR1_MARKED, FALSE, /*goto*/ 0x06)
	if_stage_flag_eq(STAGEFLAG_PILLAR2_MARKED, FALSE, /*goto*/ 0x06)
	if_stage_flag_eq(STAGEFLAG_PILLAR3_MARKED, FALSE, /*goto*/ 0x06)
	goto_next(0x2d)

	label(0x06)
	set_stage_flag(STAGEFLAG_COOP_BUGS_WASTED)
	if_self_flag_bankx_eq(CHRFLAG0_UNDERCOVER, FALSE, BANK_0, /*goto*/ 0x0f)
	set_stage_flag(STAGEFLAG_BUG_WASTED)
	show_hudmsg(CHR_COOP, L_SHO_026) // "Target Amplifier placed incorrectly."

	label(0x2d)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(0x0f)
	goto_first(0x03)

	endlist
};

u8 func1008_lock_door[] = {
	if_difficulty_lt(DIFF_SA, /*goto*/ 0x2d)
	goto_next(0x04)

	// A
	label(0x2d)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// SA and PA
	label(0x04)
	yield
	lock_door(0x09, 0x02)
	lock_door(0x0a, 0x02)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1009_altar[] = {
	if_difficulty_lt(DIFF_SA, /*goto*/ 0x0f)

	beginloop(0x08)
		chr_toggle_p1p2(CHR_SELF)
		if_object_flag2(OBJ_ALTAR, OBJFLAG2_REMOVEWHENDESTROYED, /*goto*/ 0x2d)
		if_chr_distance_to_pad_lt(CHR_P1P2, 300, PAD_SHO_0137, /*goto*/ 0x2e)
		label(0x2d)
		if_chr_activated_object(CHR_P1P2, OBJ_ALTAR, /*goto*/ 0x06)
	endloop(0x08)

	// Activated
	label(0x06)

	// Altar has flag
	label(0x2d)
	if_chr_weapon_equipped(CHR_P1P2, WEAPON_DEVASTATOR, /*goto*/ 0x92)
	if_chr_weapon_equipped(CHR_P1P2, WEAPON_CALLISTO, /*goto*/ 0x93)
	if_chr_weapon_equipped(CHR_P1P2, WEAPON_FALCON2_SCOPE, /*goto*/ 0x94)
	if_chr_weapon_equipped(CHR_P1P2, WEAPON_SLAYER, /*goto*/ 0x95)
	if_chr_weapon_equipped(CHR_P1P2, WEAPON_MAULER, /*goto*/ 0x96)

	// At pad, or invalid weapon equipped
	label(0x2e)
	set_object_flag2(OBJ_ALTAR, OBJFLAG2_REMOVEWHENDESTROYED)
	show_hudmsg(CHR_P1P2, L_SHO_051) // "Make your sacrifice to the God of War."
	restart_timer

	beginloop(0x91)
		if_timer_gt(120, /*goto*/ 0x06)
	endloop(0x91)

	label(0x06)
	goto_first(0x08)

	label(0x92)
	unset_object_flag2(OBJ_ALTAR_DEVASTATOR, OBJFLAG2_INVISIBLE)
	goto_next(0x2d)

	label(0x93)
	unset_object_flag2(OBJ_ALTAR_CALLISTO, OBJFLAG2_INVISIBLE)
	goto_next(0x2d)

	label(0x94)
	unset_object_flag2(OBJ_ALTAR_FALCON, OBJFLAG2_INVISIBLE)
	goto_next(0x2d)

	label(0x95)
	unset_object_flag2(OBJ_ALTAR_SLAYER, OBJFLAG2_INVISIBLE)
	goto_next(0x2d)

	label(0x96)
	unset_object_flag2(OBJ_ALTAR_MAULER, OBJFLAG2_INVISIBLE)
	goto_next(0x2d)

	label(0x2d)
	play_sound(SFX_80AA, -1)
	chr_drop_weapon(VERSION >= VERSION_NTSC_1_0 ? CHR_P1P2 : CHR_BOND)
	label(0x04)
	yield
	label(0x2d)
	label(0x0f)
	unlock_door(0x09, 0x02)
	unlock_door(0x0a, 0x02)
	set_lights_state(0x0060, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0061, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0062, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0063, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0064, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0065, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0066, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0067, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0068, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0069, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x006a, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x006b, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x006c, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x006d, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x006e, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x006f, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0070, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0071, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0072, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0073, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0074, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0075, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0076, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0077, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0078, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x0079, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x007a, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x007b, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x007c, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x007d, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x007e, LIGHTOP_TRANSITION, 6, 128, 120)
	set_lights_state(0x007f, LIGHTOP_TRANSITION, 6, 128, 120)
	restart_timer

	beginloop(0x0e)
		if_timer_gt(120, /*goto*/ 0x2d)
	endloop(0x0e)

	label(0x2d)
	if_difficulty_lt(DIFF_SA, /*goto*/ 0x2d)
	show_hudmsg(CHR_P1P2, L_SHO_027) // "Generator has been reactivated."
	label(0x2d)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

/**
 * This function would have cycled the lights every 20 seconds, but the cycling
 * part has been disabled.
 */
u8 func101c_setup_corridor_lighting[] = {
	label(0x59)
	restart_timer
	label(0x04)
	yield
	label(0x2d)
	set_lights_state(0x0060, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0061, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0062, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0063, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0064, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0065, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0066, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0067, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0068, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0069, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x006a, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x006b, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x006c, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x006d, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x006e, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x006f, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0070, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0071, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0072, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0073, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0074, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0076, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0078, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0079, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x007a, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x007b, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x007c, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x007d, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x007e, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x007f, LIGHTOP_SET, 6, 0, 0)
	yield
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// The rest of this function is unreachable
	restart_timer

	beginloop(0x08)
		if_timer_gt(1200, /*goto*/ 0x2d)
	endloop(0x08)

	label(0x2d)
	set_lights_state(0x0060, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0061, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0062, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0063, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0064, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0065, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0066, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0067, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0068, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0069, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x006a, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x006b, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x006c, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x006d, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x006e, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x006f, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0070, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0071, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0072, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0073, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0074, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0075, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0076, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0077, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0078, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0079, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x007a, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x007b, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x007c, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x007d, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x007e, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x007f, LIGHTOP_TRANSITION, 6, 255, 120)
	goto_first(0x59)

	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func040a_init_reaper_slayer_skedar[] = {
	set_accuracy(20)
	set_reaction_speed(75)
	set_chr_maxdamage(CHR_SELF, 40)
	add_health_or_armor(160)
	set_recovery_speed(0)
	set_shield(0)
	set_ailist(CHR_SELF, AILIST_REAPER_SLAYER_SKEDAR)
	endlist
};

u8 func0409_reaper_slayer_skedar[] = {
#if VERSION >= VERSION_NTSC_1_0
	unset_self_chrflag(CHRCFLAG_HIDDEN)
#endif
	set_shotlist(AILIST_REAPER_SLAYER_SKEDAR)
	if_chr_dead(CHR_SELF, /*goto*/ 0x06)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x06)
	goto_next(0x2d)

	// Dying
	label(0x06)
	set_shotlist(GAILIST_IDLE)
	restart_timer

	beginloop(0x5d)
		if_timer_gt(15, /*goto*/ 0x06)
	endloop(0x5d)

	label(0x06)
	say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_shotlist(GAILIST_IDLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Alive
	label(0x2d)
	if_just_injured(CHR_SELF, /*goto*/ 0x06)
	goto_next(0x08)

	// Injured
	label(0x06)
	set_view_distance(100)

	// Healthy
	label(0x08)
	set_self_chrflag(CHRCFLAG_NOFRIENDLYFIRE)
	label(0x5e)
	if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ 0x06)
	set_target_chr(CHR_BOND)
	try_attack_kneel(ATTACKFLAG_AIMATTARGET | ATTACKFLAG_AIMONLY, 0, /*goto*/ 0x5f)
	label(0x06)
	kneel

	beginloop(0x5f)
		chr_toggle_p1p2(CHR_SELF)
		label(0x2d)
		set_target_chr(CHR_P1P2)
		if_self_flag_bankx_eq(CHRFLAG0_AIVSAI, FALSE, BANK_0, /*goto*/ 0x2e)
		if_enemy_distance_lt_and_los(2540, /*goto*/ 0x60)
		label(0x2e)
		if_target_outside_my_yvisang(/*goto*/ 0x06)
		if_can_see_target(/*goto*/ 0x60)
		label(0x06)
		if_just_injured(CHR_SELF, /*goto*/ 0x58)
		label(0x2d)
		if_saw_injury(0x00, /*goto*/ 0x60)
		if_near_miss(/*goto*/ 0x61)
		label(0x2d)
		set_target_chr(CHR_P1P2)
	endloop(0x5f)

	label(0x06)
	if_target_outside_my_yvisang(/*goto*/ 0x2d)
	if_can_see_target(/*goto*/ 0x60)
	label(0x2d)
	set_target_chr(CHR_BOND)
	goto_first(0x5f)

	label(0x60)
	if_los_to_target(/*goto*/ 0x2d)
	goto_first(0x5e)

	label(0x58)
	label(0x2d)
	set_view_distance(100)
	if_self_flag_bankx_eq(CHRFLAG0_GP1, TRUE, BANK_0, /*goto*/ 0x2d)
	set_self_flag_bankx(CHRFLAG0_GP1, BANK_0)
	say_quip(CHR_BOND, QUIP_SEEPLAYER, 0xff, 0x02, 0xff, BANK_0, 0x00, 0x00)
	label(0x2d)
	goto_next(0x71)

	// Unreachable
	try_attack_amount(90, 100)

	beginloop(0x64)
		if_chr_stopped(/*goto*/ 0x63)
	endloop(0x64)

	label(0x63)
	restart_timer
	stop_chr

	beginloop(0x65)
		if_chr_weapon_equipped(CHR_SELF, WEAPON_SLAYER, /*goto*/ 0x2e)
		if_timer_gt(120, /*goto*/ 0x2d)

		label(0x2e)
		if_timer_gt(200, /*goto*/ 0x2d)
	endloop(0x65)

	label(0x2d)
	label(0x06)
	goto_first(0x5e)

	label(0x61)
	set_view_distance(100)
	restart_timer
	if_self_flag_bankx_eq(CHRFLAG0_GP1, TRUE, BANK_0, /*goto*/ 0x6a)
	set_self_flag_bankx(CHRFLAG0_GP1, BANK_0)

	label(0x6a)
	call_rng
	chr_toggle_p1p2(CHR_SELF)
	set_target_chr(CHR_P1P2)
	if_target_outside_my_yvisang(/*goto*/ 0x06)
	if_can_see_target(/*goto*/ 0x6b)
	label(0x06)
	if_timer_gt(60, /*goto*/ 0x6c)
	if_rand_lt(4, /*goto*/ 0x6c)
	goto_first(0x6a)

	label(0x6c)
	if_los_to_target(/*goto*/ 0x6b)
	goto_first(0x5e)

	label(0x6b)
	goto_first(0x60)

	label(0x6d)
	restart_timer

	beginloop(0x6e)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_los_to_target(/*goto*/ 0x6b)
		if_timer_gt(300, /*goto*/ 0x06)
	endloop(0x6e)

	label(0x06)
	goto_first(0x5e)

	label(0x6b)
	goto_first(0x60)

	label(0x71)
	if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, FALSE, BANK_0, /*goto*/ 0x72)
	try_attack_stand(ATTACKFLAG_AIMATTARGET | ATTACKFLAG_AIMONLY, 0, /*goto*/ 0x70)
	label(0x70)
	say_quip(CHR_BOND, QUIP_ATTACK1, 0x19, 0x02, 0x01, BANK_0, 0x00, 0x00)
	try_modify_attack(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x06)
	goto_next(0x2d)

	label(0x72)
	try_attack_amount(40, 60)
	dprint 'F','I','R','E',' ','F','U','L','L','\n',0,
	label(0x06)
	goto_first(0x64)

	label(0x2d)
	goto_first(0x63)

	endlist
};

u8 func100a_army_room[] = {
#if VERSION >= VERSION_NTSC_1_0
	yield
#endif
	set_lights_state(0x0082, LIGHTOP_SET, 6, 0, 0)
	set_lights_state(0x0087, LIGHTOP_SET, 6, 0, 0)

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0082, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	close_door(0x0d)
	close_door(0x0e)
	close_door(0x0f)
	close_door(0x10)
	if_objective_complete(0, /*goto*/ 0x2d)
	goto_next(0x06)

	label(0x2d)
	lock_door(0x0d, 0x02)
	lock_door(0x0e, 0x02)
	lock_door(0x0f, 0x02)
	lock_door(0x10, 0x02)
	label(0x06)
	restart_timer

	beginloop(0x08)
		if_timer_gt(180, /*goto*/ 0x06)
	endloop(0x08)

	label(0x06)
	set_lights_state(0x0082, LIGHTOP_TRANSITION, 6, 255, 120)
	set_lights_state(0x0087, LIGHTOP_TRANSITION, 6, 255, 120)
	set_stage_flag(STAGEFLAG_TRIGGER_SKEDAR_ARMY)
	play_x_track(XREASON_DEFAULT, 10, 60)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	goto_first(0x04)

	endlist
};

u8 func100b_check_sanctum_accessed[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_in_room(CHR_P1P2, 0x00, 0x007a, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	show_hudmsg(CHR_P1P2, L_SHO_028) // "Skedar Inner Sanctum has been reached."
	set_stage_flag(STAGEFLAG_ACCESSED_SANCTUM)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func040b_mauler_skedar[] = {
	set_self_chrflag(CHRCFLAG_RUNFASTER)
	set_accuracy(20)
	set_reaction_speed(50)
	set_chr_maxdamage(CHR_SELF, 40)
	add_health_or_armor(50)
	set_recovery_speed(0)
	set_shield(0)

	beginloop(0x04)
		if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	set_alertness(100)
	set_target_chr(CHR_BOND)
	try_jog_to_target(/*goto*/ 0x2d)
	label(0x2d)
	set_shotlist(GAILIST_COMBAT_WITH_TARGET)
	set_returnlist(CHR_SELF, GAILIST_COMBAT_WITH_TARGET)
	set_ailist(CHR_SELF, GAILIST_COMBAT_WITH_TARGET)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func100e_wake_skedar_army[] = {
	beginloop(0x04)
		if_stage_flag_eq(STAGEFLAG_TRIGGER_SKEDAR_ARMY, TRUE, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)

	#define enable_army_skedar(chr, loopid) \
		restart_timer \
		set_chr_flag_bankx(chr, CHRFLAG0_SKIPSAFETYCHECKS, BANK_0) \
		beginloop(loopid) \
			if_timer_gt(500, /*goto*/ 0x2d) \
		endloop(loopid) \
		label(0x2d)

	enable_army_skedar(0x2e, 0x08)
	enable_army_skedar(0x31, 0x09)
	enable_army_skedar(0x2c, 0x0b)
	enable_army_skedar(0x2f, 0x0c)
	enable_army_skedar(0x2d, 0x0d)
	enable_army_skedar(0x32, 0x0e)
	enable_army_skedar(0x30, 0x0f)

	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func040c_king_waiting[] = {
	set_shield(500)
	set_accuracy(100)
	set_chr_chrflag(CHR_SELF, CHRCFLAG_RUNFASTER)
	set_chr_hiddenflag(CHR_SELF, CHRHFLAG_WARPONSCREEN)
	if_difficulty_gt(DIFF_A, /*goto*/ 0x2d)
	set_self_chrflag(CHRCFLAG_LOSEXTRAHEIGHT)
	label(0x2d)
	set_self_chrflag(CHRCFLAG_INVINCIBLE)
	set_chr_hiddenflag(CHR_SELF, CHRHFLAG_INFINITESHIELD)
	set_morale(0)

	beginloop(0x08)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0088, /*goto*/ 0x2d)
	endloop(0x08)

	label(0x2d)
#if VERSION >= VERSION_NTSC_1_0
	stop_x_track(-1)
#endif
	play_track_isolated(MUSIC_SKEDARRUINS_KING)
	restart_timer

	beginloop(0x09)
		if_timer_gt(300, /*goto*/ 0x2d)
	endloop(0x09)

	label(0x2d)
	unset_self_chrflag(CHRCFLAG_INVINCIBLE)
	set_ailist(CHR_SELF, AILIST_KING_COMBAT)
	endlist
};

/**
 * morale tracks how many rockets have been fired in a row.
 */
u8 func040d_king_combat[] = {
#define LABEL_MAINLOOP         0x03
#define LABEL_PLAYER_DEAD      0x11
#define LABEL_FIRE_ROCKET      0x73
#define LABEL_SPAWN_SKEDAR     0x74
#define LABEL_SPAWN_MINISKEDAR 0x75
#define LABEL_CLOAK            0x76
#define LABEL_LOW_SHIELD       0x7c

	beginloop(0x59)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_can_see_attack_target(/*goto*/ 0x03)
		if_chr_shield_lt(CHR_SELF, 20, /*goto*/ LABEL_LOW_SHIELD)
	endloop(0x59)

	// Main loop
	label(LABEL_MAINLOOP)
	chr_toggle_p1p2(CHR_SELF)
	set_target_chr(CHR_P1P2)
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x04)

	beginloop(0x04)
		if_chr_death_animation_finished(CHR_P1P2, /*goto*/ LABEL_PLAYER_DEAD)
		if_chr_shield_lt(CHR_SELF, 20, /*goto*/ LABEL_LOW_SHIELD)
		if_stage_flag_eq(STAGEFLAG_KING_SKEDAR_CLONE_EXISTS, TRUE, /*goto*/ 0x2d)
		if_stage_flag_eq(STAGEFLAG_KING_MINISKEDAR_CLONE_EXISTS, TRUE, /*goto*/ 0x2d)

		// No clones exist
		call_rng
		if_rand_gt(200, /*goto*/ 0x79)
		if_morale_lt(2, /*goto*/ 0x06)
		goto_next(0x2d)

		label(0x06)
		goto_next(LABEL_FIRE_ROCKET)

		label(0x79)
		if_rand_gt(237, /*goto*/ 0x07)
		if_rand_gt(218, /*goto*/ 0x06)
		goto_next(LABEL_SPAWN_MINISKEDAR)

		label(0x06)
		goto_next(LABEL_SPAWN_SKEDAR)

		label(0x07)
		goto_next(LABEL_CLOAK)

		label(0x2d)
	endloop(0x04)

	//
	// Run to side and fire a rocket
	//
	label(LABEL_FIRE_ROCKET)
	restart_timer
	if_chr_distance_to_pad_lt(CHR_SELF, 300, PAD_SHO_0098, /*goto*/ 0x06)
	jog_to_pad(PAD_SHO_0098) // left side (when facing king)
	goto_next(0x7f)

	label(0x06)
	restart_timer
	jog_to_pad(PAD_SHO_0097) // right side

	beginloop(0x7f)
		if_chr_death_animation_finished(CHR_P1P2, /*goto*/ LABEL_PLAYER_DEAD)
		if_chr_shield_lt(CHR_SELF, 20, /*goto*/ LABEL_LOW_SHIELD)
		if_chr_stopped(/*goto*/ 0x2d)
	endloop(0x7f)

	label(0x2d)
	set_self_chrflag(CHRCFLAG_NOFRIENDLYFIRE)

	beginloop(0x7a)
		if_chr_death_animation_finished(CHR_P1P2, /*goto*/ LABEL_PLAYER_DEAD)
		if_chr_shield_lt(CHR_SELF, 20, /*goto*/ LABEL_LOW_SHIELD)
		if_can_see_attack_target(/*goto*/ 0x06)
	endloop(0x7a)

	label(0x06)
	say_quip(CHR_BOND, QUIP_ATTACK2, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	try_attack_stand(ATTACKFLAG_AIMATTARGET | ATTACKFLAG_AIMONLY, 0, /*goto*/ 0x70)
	label(0x70)
	say_quip(CHR_BOND, QUIP_ATTACK1, 0x19, 0x02, 0x01, BANK_0, 0x00, 0x00)
	try_modify_attack(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x7b)
	goto_next(0x2d)

	label(0x06)
	goto_first(LABEL_MAINLOOP)

	// Shoot successful
	beginloop(0x7b)
		if_chr_death_animation_finished(CHR_P1P2, /*goto*/ LABEL_PLAYER_DEAD)
		if_chr_shield_lt(CHR_SELF, 20, /*goto*/ LABEL_LOW_SHIELD)
		if_chr_stopped(/*goto*/ 0x2d)
	endloop(0x7b)

	label(0x2d)
	add_morale(1)
	goto_first(LABEL_MAINLOOP)

	//
	// Spawn skedar
	//
	label(LABEL_SPAWN_SKEDAR)
	say_quip(CHR_BOND, QUIP_ATTACK2, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_morale(0)
	restart_timer
	chr_do_animation(ANIM_0350, 0, -1, CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2)

	beginloop(0x66)
		if_chr_death_animation_finished(CHR_P1P2, /*goto*/ LABEL_PLAYER_DEAD)
		if_chr_shield_lt(CHR_SELF, 20, /*goto*/ LABEL_LOW_SHIELD)
		if_timer_gt(120, /*goto*/ 0x2d)
	endloop(0x66)

	label(0x2d)
	set_chr_flag_bankx(CHR_KING_SKEDAR_SPAWNER, CHRFLAG0_SKIPSAFETYCHECKS, BANK_0)
	goto_first(LABEL_MAINLOOP)

	//
	// Spawn miniskedar
	//
	label(LABEL_SPAWN_MINISKEDAR)
	say_quip(CHR_BOND, QUIP_ATTACK2, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_morale(0)
	restart_timer
	chr_do_animation(ANIM_0350, 0, -1, CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2)

	beginloop(0x67)
		if_chr_death_animation_finished(CHR_P1P2, /*goto*/ LABEL_PLAYER_DEAD)
		if_chr_shield_lt(CHR_SELF, 20, /*goto*/ LABEL_LOW_SHIELD)
		if_timer_gt(120, /*goto*/ 0x2d)
	endloop(0x67)

	label(0x2d)
	set_chr_flag_bankx(CHR_KING_MINISKEDAR_SPAWNER, CHRFLAG0_SKIPSAFETYCHECKS, BANK_0)
	goto_first(LABEL_MAINLOOP)

	//
	// Cloak and warp to player for hand combat
	//
	label(LABEL_CLOAK)
	say_quip(CHR_BOND, QUIP_ATTACK2, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_morale(0)
	restart_timer
	chr_do_animation(ANIM_0350, 0, -1, CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2)
	set_chr_cloaked(CHR_SELF, TRUE, TRUE)

	beginloop(0x68)
		if_chr_death_animation_finished(CHR_P1P2, /*goto*/ LABEL_PLAYER_DEAD)
		if_timer_gt(120, /*goto*/ 0x2d)
	endloop(0x68)

	label(0x2d)
	try_set_padpreset_to_target_quadrant(QUADRANT_BACK, /*goto*/ 0x2d)
	try_set_padpreset_to_target_quadrant(QUADRANT_SIDE1, /*goto*/ 0x2d)
	try_set_padpreset_to_target_quadrant(QUADRANT_SIDE2, /*goto*/ 0x2d)
	goto_next(0x88)

	label(0x2d)
	chr_move_to_pad(CHR_SELF, PAD_PRESET, FALSE, /*goto*/ 0x2d)
	goto_next(0x88)

	label(0x2d)
	set_countdown_timer(7)
	start_countdown_timer

	label(0x8a)
	restart_timer
	try_run_to_target(/*goto*/ 0x08)

	beginloop(0x08)
		if_chr_death_animation_finished(CHR_P1P2, /*goto*/ 0x0b)
		if_timer_gt(20, /*goto*/ 0x89)
		if_distance_to_target_lt(150, /*goto*/ 0x06)
	endloop(0x08)

	// Unreachable
	label(0x2d)
	goto_next(0x88)

	// Every 20 frames - check countdown timer
	label(0x89)
	if_countdown_timer_lt(1, /*goto*/ 0x2d)
	goto_first(0x8a)

	// Been chasing player while cloaked for 7 seconds
	label(0x2d)
	goto_next(0x88)

	// Distance to player < 150
	label(0x06)
	say_quip(CHR_BOND, QUIP_ATTACK2, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_chr_cloaked(CHR_SELF, FALSE, TRUE)
	restart_timer
	dprint 'F','A','C','E',' ','T','A','R','G','E','T','\n',0,
	if_target_in_fov_left(10, /*goto*/ 0x06)
	if_target_out_of_fov_left(246, /*goto*/ 0x06)
	stop_chr
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x09)

	beginloop(0x09)
		if_chr_death_animation_finished(CHR_P1P2, /*goto*/ 0x0b)
		if_target_in_fov_left(10, /*goto*/ 0x06)
		if_target_out_of_fov_left(246, /*goto*/ 0x06)
		if_timer_gt(60, /*goto*/ 0x06)
	endloop(0x09)

	label(0x2d)
	goto_next(0x87)

	label(0x06)
	dprint 'P','U','N','C','H','\n',0,
	try_punch_or_kick(/*goto*/ 0x0b)
	goto_next(0x87)

	beginloop(0x0b)
		if_chr_stopped(/*goto*/ 0x2d)
	endloop(0x0b)

	label(0x2d)
	restart_timer
	set_chr_cloaked(CHR_SELF, TRUE, TRUE)

	beginloop(0x0d)
		if_timer_gt(120, /*goto*/ 0x2d)
	endloop(0x0d)

	label(0x2d)
	label(0x88)
	stop_chr
	chr_move_to_pad(CHR_SELF, PAD_SHO_0097, FALSE, /*goto*/ 0x87)
	chr_move_to_pad(CHR_SELF, PAD_SHO_0096, FALSE, /*goto*/ 0x87)
	chr_move_to_pad(CHR_SELF, PAD_SHO_0098, FALSE, /*goto*/ 0x87)

	label(0x87)
	set_chr_cloaked(CHR_SELF, FALSE, TRUE)
	restart_timer

	beginloop(0x85)
		if_timer_gt(120, /*goto*/ 0x2d)
	endloop(0x85)

	label(0x2d)
	goto_first(LABEL_MAINLOOP)

	// Unreachable - nothing jumps here
	label(0x77)
	say_quip(CHR_BOND, QUIP_ATTACK2, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_morale(0)
	restart_timer
	chr_do_animation(ANIM_0350, 0, -1, CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2)

	beginloop(0x69)
		if_chr_shield_lt(CHR_SELF, 20, /*goto*/ LABEL_LOW_SHIELD)
		if_timer_gt(120, /*goto*/ 0x2d)
	endloop(0x69)

	label(0x2d)
	goto_first(LABEL_MAINLOOP)

	// Shield < 20
	label(LABEL_LOW_SHIELD)
	say_quip(CHR_BOND, QUIP_GOTOCOVER1, 0xff, 0x00, 0xff, BANK_0, 0x00, 0x00)
	jog_to_pad(PAD_SHO_0096)

	beginloop(0x7d)
		if_chr_stopped(/*goto*/ 0x06)
	endloop(0x7d)

	label(0x06)
	restart_timer
	set_stage_flag(STAGEFLAG_SPIKES_VULNERABLE)
	chr_do_animation(ANIM_0351, 0, -1, CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2)

	beginloop(0x7e)
		if_stage_flag_eq(STAGEFLAG_SPIKE_DESTROYED, TRUE, /*goto*/ 0x06)
		if_timer_gt(500, /*goto*/ 0x06)
	endloop(0x7e)

	label(0x06)
	stop_chr
	unset_stage_flag(STAGEFLAG_SPIKE_DESTROYED)
	if_stage_flag_eq(STAGEFLAG_SPIKE4_DESTROYED, TRUE, /*goto*/ 0x83)
	if_stage_flag_eq(STAGEFLAG_SPIKE3_DESTROYED, TRUE, /*goto*/ 0x82)
	if_stage_flag_eq(STAGEFLAG_SPIKE2_DESTROYED, TRUE, /*goto*/ 0x81)
	if_stage_flag_eq(STAGEFLAG_SPIKE1_DESTROYED, TRUE, /*goto*/ 0x80)

	set_shield(500)
	goto_next(0x06)

	label(0x80)
	set_shield(400)
	goto_next(0x06)

	label(0x81)
	set_shield(300)
	goto_next(0x06)

	label(0x82)
	set_shield(200)
	goto_next(0x06)

	label(0x83)
	set_shield(100)

	label(0x06)
	unset_stage_flag(STAGEFLAG_SPIKES_VULNERABLE)
	goto_first(LABEL_MAINLOOP)

	// Player dead
	label(LABEL_PLAYER_DEAD)
	goto_first(0x59)

	endlist
};

u8 func040e_king_skedar_spawner[] = {
	set_self_chrflag(CHRCFLAG_CLONEABLE)
	set_self_chrflag(CHRCFLAG_HIDDEN)
#if VERSION >= VERSION_NTSC_1_0
	set_self_chrflag(CHRCFLAG_INVINCIBLE)
#endif
	set_self_chrflag(CHRCFLAG_NEVERSLEEP)
	set_chr_hiddenflag(CHR_SELF, CHRHFLAG_WARPONSCREEN)

	beginloop(0x04)
		if_chr_death_animation_finished(CHR_CLONE, /*goto*/ 0x2d)
#if VERSION >= VERSION_NTSC_1_0
		if_chr_dead(CHR_CLONE, /*goto*/ 0x2d)
		if_chr_knockedout(CHR_CLONE, /*goto*/ 0x2d)
#endif
		goto_next(0x06)

		// Clone dead
		label(0x2d)
		unset_stage_flag(STAGEFLAG_KING_SKEDAR_CLONE_EXISTS)

		label(0x06)
		if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ 0x4f)
		reloop(0x04)

		label(0x4f)
		if_chr_death_animation_finished(CHR_CLONE, /*goto*/ 0x4f)
#if VERSION >= VERSION_NTSC_1_0
		if_chr_dead(CHR_CLONE, /*goto*/ 0x4f)
		if_chr_knockedout(CHR_CLONE, /*goto*/ 0x4f)
#endif
		reloop(0x04)

		label(0x4f)
		try_spawn_clone2(CHR_SELF, AILIST_INIT_KING_SKEDAR_CLONE, SPAWNFLAG_ALLOWONSCREEN, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		unset_self_flag_bankx(CHRFLAG0_SKIPSAFETYCHECKS, BANK_0)
		set_stage_flag(STAGEFLAG_KING_SKEDAR_CLONE_EXISTS)
		yield
	endloop(0x04)

	endlist
};

u8 func0410_init_king_skedar_clone[] = {
	set_self_chrflag(CHRCFLAG_NEVERSLEEP)
	set_self_chrflag(CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_SELF, CHRHFLAG_CLOAKED)
	yield
	try_equip_weapon(MODEL_CHRMAULER, WEAPON_MAULER, 0x20000000, /*goto*/ 0x06)
	label(0x06)
	yield
	yield
	yield
	yield
	unset_self_chrflag(CHRCFLAG_HIDDEN)
	set_chr_cloaked(CHR_SELF, FALSE, TRUE)
	set_ailist(CHR_SELF, AILIST_INIT_UNARMED_SKEDAR)
	endlist
};

u8 func0411_king_miniskedar_spawner[] = {
	set_self_chrflag(CHRCFLAG_CLONEABLE)
	set_self_chrflag(CHRCFLAG_HIDDEN)
#if VERSION >= VERSION_NTSC_1_0
	set_self_chrflag(CHRCFLAG_INVINCIBLE)
#endif
	set_self_chrflag(CHRCFLAG_NEVERSLEEP)
	set_chr_hiddenflag(CHR_SELF, CHRHFLAG_WARPONSCREEN)

	beginloop(0x04)
		if_chr_death_animation_finished(CHR_CLONE, /*goto*/ 0x2d)
#if VERSION >= VERSION_NTSC_1_0
		if_chr_dead(CHR_CLONE, /*goto*/ 0x2d)
		if_chr_knockedout(CHR_CLONE, /*goto*/ 0x2d)
#endif
		goto_next(0x06)

		// Clone dead
		label(0x2d)
		unset_stage_flag(STAGEFLAG_KING_MINISKEDAR_CLONE_EXISTS)
		label(0x06)
		if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ 0x4f)
		reloop(0x04)

		// Clone dead and flag set
		// Redundant check
		label(0x4f)
		if_chr_death_animation_finished(CHR_CLONE, /*goto*/ 0x4f)
#if VERSION >= VERSION_NTSC_1_0
		if_chr_dead(CHR_CLONE, /*goto*/ 0x4f)
		if_chr_knockedout(CHR_CLONE, /*goto*/ 0x4f)
#endif
		reloop(0x04)

		// Spawn clone
		label(0x4f)
		try_spawn_clone2(CHR_SELF, AILIST_INIT_KING_MINISKEDAR_CLONE, SPAWNFLAG_ALLOWONSCREEN, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		unset_self_flag_bankx(CHRFLAG0_SKIPSAFETYCHECKS, BANK_0)
		set_stage_flag(STAGEFLAG_KING_MINISKEDAR_CLONE_EXISTS)
		yield
	endloop(0x04)

	endlist
};

u8 func0412_init_king_miniskedar_clone[] = {
	set_self_chrflag(CHRCFLAG_NEVERSLEEP)
	set_self_chrflag(CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_SELF, CHRHFLAG_CLOAKED)
	yield
	try_equip_weapon(MODEL_CHRMAULER, WEAPON_MAULER, 0x20000000, /*goto*/ 0x06)
	label(0x06)
	yield
	yield
	yield
	yield
	unset_self_chrflag(CHRCFLAG_HIDDEN)
	set_chr_cloaked(CHR_SELF, FALSE, TRUE)
	set_ailist(CHR_SELF, AILIST_INIT_MINISKEDAR)
	endlist
};

u8 func100f_spikes_vulnerability[] = {
	set_object_flag2(OBJ_SPIKE_ML, OBJFLAG2_BOUNCEIFSHOTWHENDEAD | OBJFLAG2_IMMUNETOEXPLOSIONS)
	set_object_flag2(OBJ_SPIKE_MR, OBJFLAG2_BOUNCEIFSHOTWHENDEAD | OBJFLAG2_IMMUNETOEXPLOSIONS)
	set_object_flag2(OBJ_SPIKE_BL, OBJFLAG2_BOUNCEIFSHOTWHENDEAD | OBJFLAG2_IMMUNETOEXPLOSIONS)
	set_object_flag2(OBJ_SPIKE_BR, OBJFLAG2_BOUNCEIFSHOTWHENDEAD | OBJFLAG2_IMMUNETOEXPLOSIONS)
	set_object_flag2(OBJ_SPIKE_T, OBJFLAG2_BOUNCEIFSHOTWHENDEAD | OBJFLAG2_IMMUNETOEXPLOSIONS)

	beginloop(0x91)
		if_stage_flag_eq(STAGEFLAG_IN_INTRO, FALSE, /*goto*/ 0x86)
	endloop(0x91)

	label(0x86)
	label(0x03)
	set_object_flag(OBJ_SPIKE_ML, OBJFLAG_INVINCIBLE)
	set_object_flag(OBJ_SPIKE_MR, OBJFLAG_INVINCIBLE)
	set_object_flag(OBJ_SPIKE_BL, OBJFLAG_INVINCIBLE)
	set_object_flag(OBJ_SPIKE_BR, OBJFLAG_INVINCIBLE)
	set_object_flag(OBJ_SPIKE_T, OBJFLAG_INVINCIBLE)
	set_object_flag3(OBJ_SPIKE_ML, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD)
	set_object_flag3(OBJ_SPIKE_MR, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD)
	set_object_flag3(OBJ_SPIKE_BL, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD)
	set_object_flag3(OBJ_SPIKE_BR, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD)
	set_object_flag3(OBJ_SPIKE_T, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD)

	beginloop(0x04)
		if_stage_flag_eq(STAGEFLAG_SPIKES_VULNERABLE, TRUE, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	unset_object_flag(OBJ_SPIKE_ML, OBJFLAG_INVINCIBLE)
	unset_object_flag(OBJ_SPIKE_MR, OBJFLAG_INVINCIBLE)
	unset_object_flag(OBJ_SPIKE_BL, OBJFLAG_INVINCIBLE)
	unset_object_flag(OBJ_SPIKE_BR, OBJFLAG_INVINCIBLE)
	unset_object_flag3(OBJ_SPIKE_ML, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD)
	unset_object_flag3(OBJ_SPIKE_MR, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD)
	unset_object_flag3(OBJ_SPIKE_BL, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD)
	unset_object_flag3(OBJ_SPIKE_BR, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD)

	if_stage_flag_eq(STAGEFLAG_SPIKE1_DESTROYED, FALSE, /*goto*/ 0x08)
	if_stage_flag_eq(STAGEFLAG_SPIKE2_DESTROYED, FALSE, /*goto*/ 0x08)
	if_stage_flag_eq(STAGEFLAG_SPIKE3_DESTROYED, FALSE, /*goto*/ 0x08)
	if_stage_flag_eq(STAGEFLAG_SPIKE4_DESTROYED, FALSE, /*goto*/ 0x08)
	unset_object_flag(OBJ_SPIKE_T, OBJFLAG_INVINCIBLE)
	unset_object_flag3(OBJ_SPIKE_T, OBJFLAG3_SHOWSHIELD | OBJFLAG3_HOVERBEDSHIELD)

	beginloop(0x08)
		if_stage_flag_eq(STAGEFLAG_SPIKES_VULNERABLE, FALSE, /*goto*/ 0x2d)
	endloop(0x08)

	label(0x2d)
	goto_first(0x03)

	endlist
};

#define wait_for_spike_destroyed(spike, shadow, noshadow) \
	beginloop(0x03) \
		if_object_in_good_condition(spike, /*goto*/ 0x2d) \
		goto_next(0x06) \
 \
		label(0x2d) \
	endloop(0x03) \
 \
	label(0x06) \
	set_object_flag2(shadow, OBJFLAG2_INVISIBLE) \
	unset_object_flag2(noshadow, OBJFLAG2_INVISIBLE)

u8 func1010_spike_ml[] = {
	wait_for_spike_destroyed(OBJ_SPIKE_ML, OBJ_SPIKE_SHAD_ML, OBJ_SPIKE_NOSHAD_ML)
	set_ailist(CHR_SELF, AILIST_UPDATE_SPIKE_STAGEFLAGS)
	endlist
};

u8 func1011_spike_mr[] = {
	wait_for_spike_destroyed(OBJ_SPIKE_MR, OBJ_SPIKE_SHAD_MR, OBJ_SPIKE_NOSHAD_MR)
	set_ailist(CHR_SELF, AILIST_UPDATE_SPIKE_STAGEFLAGS)
	endlist
};

u8 func1012_spike_bl[] = {
	wait_for_spike_destroyed(OBJ_SPIKE_BL, OBJ_SPIKE_SHAD_BL, OBJ_SPIKE_NOSHAD_BL)
	set_ailist(CHR_SELF, AILIST_UPDATE_SPIKE_STAGEFLAGS)
	endlist
};

u8 func1013_spike_br[] = {
	wait_for_spike_destroyed(OBJ_SPIKE_BR, OBJ_SPIKE_SHAD_BR, OBJ_SPIKE_NOSHAD_BR)
	set_ailist(CHR_SELF, AILIST_UPDATE_SPIKE_STAGEFLAGS)
	endlist
};

u8 func1014_spike_top[] = {
	wait_for_spike_destroyed(OBJ_SPIKE_T, OBJ_SPIKE_SHAD_T, OBJ_SPIKE_NOSHAD_T)

	set_stage_flag(STAGEFLAG_SPIKE5_DESTROYED)
	yield
	if_chr_death_animation_finished(CHR_BOND, /*goto*/ 0x2d)
	if_chr_dead(CHR_BOND, /*goto*/ 0x2d)
	if_chr_knockedout(CHR_BOND, /*goto*/ 0x2d)
	goto_next(0x06)

	label(0x2d)
	if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x2d)
	if_chr_dead(CHR_COOP, /*goto*/ 0x2d)
	if_chr_knockedout(CHR_COOP, /*goto*/ 0x2d)
	goto_next(0x06)

	label(0x2d)
	end_level
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(0x06)
	set_invincible(CHR_BOND)
	set_ailist(CHR_SELF, AILIST_OUTRO)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func040f_update_spike_stageflags[] = {
	if_stage_flag_eq(STAGEFLAG_SPIKE1_DESTROYED, TRUE, /*goto*/ 0x09)
	set_stage_flag(STAGEFLAG_SPIKE1_DESTROYED)
	set_stage_flag(STAGEFLAG_SPIKE_DESTROYED)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(0x09)
	if_stage_flag_eq(STAGEFLAG_SPIKE2_DESTROYED, TRUE, /*goto*/ 0x0b)
	set_stage_flag(STAGEFLAG_SPIKE2_DESTROYED)
	set_stage_flag(STAGEFLAG_SPIKE_DESTROYED)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(0x0b)
	if_stage_flag_eq(STAGEFLAG_SPIKE3_DESTROYED, TRUE, /*goto*/ 0x0c)
	set_stage_flag(STAGEFLAG_SPIKE3_DESTROYED)
	set_stage_flag(STAGEFLAG_SPIKE_DESTROYED)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(0x0c)
	set_stage_flag(STAGEFLAG_SPIKE4_DESTROYED)
	set_stage_flag(STAGEFLAG_SPIKE_DESTROYED)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0c00_intro[] = {
	set_chr_chrflag(CHR_COOP, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_ANTI, CHRCFLAG_HIDDEN)
	play_cutscene_track(MUSIC_SKEDARRUINS_INTRO)
	set_stage_flag(STAGEFLAG_IN_INTRO)
	set_chr_chrflag(CHR_BOND, CHRCFLAG_RUNFASTER)
	set_chr_chrflag(CHR_KING2, CHRCFLAG_HIDDEN)
	camera_movement(ANIM_CUT_SHO_INTRO_CAM_01)

	beginloop(0x08)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x08)

	label(0x86)
	if_controller_button_pressed(/*goto*/ 0x86)
	camera_movement(ANIM_CUT_SHO_INTRO_CAM_02)

	set_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE)
	set_chr_hiddenflag(CHR_BOND, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_JO_01, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_BOND, 4)

	set_chr_chrflag(CHR_ELVIS, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_ELVIS, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_ELVIS, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_ELVIS_01, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_ELVIS, 4)

	set_cutscene_weapon(CHR_BOND, WEAPON_NONE, WEAPON_NONE)
	yield
	set_cutscene_weapon(CHR_BOND, WEAPON_CALLISTO, WEAPON_NONE)

	beginloop(0x09)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x09)

	label(0x86)
	unset_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_ELVIS, CHRCFLAG_UNPLAYABLE)
	if_controller_button_pressed(/*goto*/ 0x86)
	camera_movement(ANIM_CUT_SHO_INTRO_CAM_03)

	set_chr_chrflag(0x37, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x37, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x37, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR1_01, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x37, 4)

	set_chr_chrflag(0x38, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x38, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x38, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR2_01, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x38, 4)

	set_chr_chrflag(0x39, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x39, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x39, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR3_01, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x39, 4)

	beginloop(0x0b)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x0b)

	label(0x86)
	unset_chr_chrflag(0x37, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x38, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x39, CHRCFLAG_UNPLAYABLE)
	if_controller_button_pressed(/*goto*/ 0x86)
	camera_movement(ANIM_CUT_SHO_INTRO_CAM_04)

	set_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE)
	set_chr_hiddenflag(CHR_BOND, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_JO_02, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_BOND, 4)

	set_chr_chrflag(CHR_ELVIS, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_ELVIS, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_ELVIS, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_ELVIS_02, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_ELVIS, 4)

	set_cutscene_weapon(CHR_BOND, WEAPON_NONE, WEAPON_NONE)
	yield
	set_cutscene_weapon(CHR_BOND, WEAPON_DEVASTATOR, WEAPON_NONE)

	beginloop(0x0c)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x0c)

	label(0x86)
	unset_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_ELVIS, CHRCFLAG_UNPLAYABLE)
	if_controller_button_pressed(/*goto*/ 0x86)
	camera_movement(ANIM_CUT_SHO_INTRO_CAM_05)

	set_chr_chrflag(0x37, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x37, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x37, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR1_02, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x37, 4)

	set_chr_chrflag(0x38, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x38, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x38, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR2_02, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x38, 4)

	set_chr_chrflag(0x39, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x39, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x39, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR3_02, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x39, 4)

	set_chr_chrflag(0x3a, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x3a, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x3a, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR4_01, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x3a, 4)

	beginloop(0x0d)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x0d)

	label(0x86)
	unset_chr_chrflag(0x37, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x38, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x39, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x3a, CHRCFLAG_UNPLAYABLE)
	if_controller_button_pressed(/*goto*/ 0x86)
	camera_movement(ANIM_CUT_SHO_INTRO_CAM_06)

	enable_object(0x36)
	set_object_flag2(0x36, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x36, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_INTRO_SKSHUTTLE_01, 0x36, 0x01, 0xffff)
	object_set_modelpart_visible(0x36, MODELPART_SKSHUTTLE_GANGWAY, FALSE)

	beginloop(0x0e)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x0e)

	label(0x86)
	disable_object(0x36)
	if_controller_button_pressed(/*goto*/ 0x86)
	camera_movement(ANIM_CUT_SHO_INTRO_CAM_07)

	set_chr_chrflag(0x37, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x37, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x37, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR1_03, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x37, 4)

	set_chr_chrflag(0x38, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x38, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x38, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR2_03, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x38, 4)

	set_chr_chrflag(0x39, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x39, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x39, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR3_03, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x39, 4)

	set_chr_chrflag(0x3a, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x3a, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(0x3a, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_SKEDAR4_02, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, 0x3a, 4)

	unset_chr_chrflag(CHR_KING2, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_KING2, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_KING2, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_KING2, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_KING, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_KING2, 4)

	set_cutscene_weapon(CHR_BOND, WEAPON_NONE, WEAPON_NONE)
	yield
	set_cutscene_weapon(CHR_BOND, WEAPON_FALCON2_SCOPE, WEAPON_NONE)

	beginloop(0x0f)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x0f)

	label(0x86)
	unset_chr_chrflag(0x37, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x38, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x39, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(0x3a, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_KING2, CHRCFLAG_UNPLAYABLE)
	camera_movement(ANIM_CUT_SHO_INTRO_CAM_08)
	cmd0175(60)
	if_controller_button_pressed(/*goto*/ 0x86)

	enable_object(0x36)
	set_object_flag2(0x36, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x36, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_INTRO_SKSHUTTLE_02, 0x36, 0x04, 0xffff)
	object_set_modelpart_visible(0x36, MODELPART_SKSHUTTLE_GANGWAY, FALSE)

	set_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE)
	set_chr_hiddenflag(CHR_BOND, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_JO_03, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_BOND, 4)

	beginloop(0x10)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x10)

	label(0x86)
	unset_stage_flag(STAGEFLAG_IN_INTRO)
	unset_chr_chrflag(CHR_BOND, CHRCFLAG_RUNFASTER)
	mute_channel(CHANNEL_7)
	label(0x06)
	unset_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE)
	set_chr_hiddenflag(CHR_BOND, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_INTRO_JO_03, -2, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_BOND, 2)
	disable_object(0x36)
	remove_chr(0x37)
	remove_chr(0x38)
	remove_chr(0x39)
	remove_chr(0x3a)
	remove_chr(CHR_KING2)
	unset_chr_chrflag(CHR_KING1, CHRCFLAG_HIDDEN)
	set_ailist(CHR_KING1, AILIST_KING_WAITING)
	set_object_flag2(0x2a, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag2(0x2b, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag2(0x2c, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag2(0x2d, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag2(0x2e, OBJFLAG2_CANFILLVIEWPORT)
	unset_chr_chrflag(CHR_COOP, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(CHR_ANTI, CHRCFLAG_HIDDEN)
	stop_cutscene_track
	stop_ambient_track
	enter_firstperson
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0414_outro_from_menu[] = {
	set_ailist(CHR_ELVIS, GAILIST_IDLE)
#if VERSION >= VERSION_NTSC_1_0
	disable_object(OBJ_SPIKE_ML)
	disable_object(OBJ_SPIKE_MR)
	disable_object(OBJ_SPIKE_BL)
	disable_object(OBJ_SPIKE_BR)
#endif
	set_ailist(CHR_SELF, AILIST_OUTRO)
	endlist
};

u8 func0414_outro[] = {
	if_chr_death_animation_finished(CHR_BOND, /*goto*/ 0x2d)
	set_target_chr(CHR_BOND)
	goto_next(0x06)

	label(0x2d)
	set_target_chr(CHR_COOP)

	label(0x06)
	set_chr_chrflag(CHR_TARGET, CHRCFLAG_KILLCOUNTABLE)
	camera_movement(ANIM_CUT_SHO_OUTRO_CAM_01)
	play_cutscene_track(MUSIC_SKEDARRUINS_OUTRO)
	set_chr_chrflag(CHR_ANTI, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_P1P2_OPPOSITE, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_P1P2, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(CHR_TARGET, CHRCFLAG_HIDDEN)
	set_ailist(CHR_TARGET, GAILIST_IDLE)
	remove_chr(0x05)
	remove_chr(0x06)
	remove_chr(0x07)
	remove_chr(0x08)
	remove_chr(0x09)
	remove_chr(0x0a)
	remove_chr(0x0b)
	remove_chr(0x0c)
	remove_chr(0x0d)
	remove_chr(0x0e)
	remove_chr(0x17)
	remove_chr(0x0f)
	remove_chr(0x10)
	remove_chr(0x0d)
	remove_chr(0x1c)
	remove_chr(0x18)
	remove_chr(0x19)
	remove_chr(0x1a)
	remove_chr(0x11)
	remove_chr(0x12)
	remove_chr(0x13)
	remove_chr(0x14)
	remove_chr(0x1b)
	remove_chr(0x15)
	remove_chr(0x16)
	remove_chr(0x1d)
	remove_chr(0x1e)
	remove_chr(0x1f)
	set_ailist(CHR_KING1, GAILIST_IDLE)

	set_chr_chrflag(CHR_KING1, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_KING1, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_KING1, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_OUTRO_KING_01, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_KING1, 4)

	object_do_animation(ANIM_CUT_SHO_OUTRO_SPIKE_01, OBJ_SPIKE_T, 0x04, 0xffff)
	set_stage_flag(STAGEFLAG_IN_OUTRO)
	show_nonessential_chrs(FALSE)

	beginloop(0x08)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x08)

	label(0x86)
	camera_movement(ANIM_CUT_SHO_OUTRO_CAM_02)

	set_chr_chrflag(CHR_KING1, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_KING1, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_KING1, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_OUTRO_KING_02, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_KING1, 4)

	set_chr_chrflag(CHR_TARGET, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_TARGET, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_TARGET, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_OUTRO_JO_01, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_TARGET, 4)

	object_do_animation(ANIM_CUT_SHO_OUTRO_SPIKE_02, OBJ_SPIKE_T, 0x04, 0xffff)

	enable_object(0x37)
	set_object_flag2(0x37, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x37, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_OUTRO_RUBBLE05, 0x37, 0x04, 0xffff)

	enable_object(0x38)
	set_object_flag2(0x38, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x38, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_OUTRO_RUBBLE06, 0x38, 0x04, 0xffff)

	enable_object(0x39)
	set_object_flag2(0x39, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x39, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_OUTRO_RUBBLE07, 0x39, 0x04, 0xffff)

	enable_object(0x3a)
	set_object_flag2(0x3a, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x3a, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_OUTRO_RUBBLE08, 0x3a, 0x04, 0xffff)

	enable_object(0x3b)
	set_object_flag2(0x3b, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x3b, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_OUTRO_RUBBLE09, 0x3b, 0x04, 0xffff)
	enable_object(0x3c)

	set_object_flag2(0x3c, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x3c, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_OUTRO_RUBBLE10, 0x3c, 0x04, 0xffff)

	beginloop(0x09)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x09)

	label(0x86)
	disable_object(0x3c)
	camera_movement(ANIM_CUT_SHO_OUTRO_CAM_03)

	set_chr_chrflag(CHR_TARGET, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_TARGET, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_TARGET, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_OUTRO_JO_02, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_TARGET, 4)

	set_chr_chrflag(CHR_ELVIS, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_ELVIS, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_ELVIS, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_SHO_OUTRO_ELVIS_02, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_ELVIS, 4)

	enable_object(0x23)
	set_object_flag2(0x23, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x23, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_OUTRO_RUBBLE01, 0x23, 0x04, 0xffff)

	enable_object(0x24)
	set_object_flag2(0x24, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x24, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_OUTRO_RUBBLE02, 0x24, 0x04, 0xffff)

	enable_object(0x25)
	set_object_flag2(0x25, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x25, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_OUTRO_RUBBLE03, 0x25, 0x04, 0xffff)

	enable_object(0x26)
	set_object_flag2(0x26, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x26, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_SHO_OUTRO_RUBBLE04, 0x26, 0x04, 0xffff)

	beginloop(0x0b)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x86)

		label(0x2d)
		if_controller_button_pressed(/*goto*/ 0x86)
		label(0x2d)
	endloop(0x0b)

	label(0x86)
	unset_chr_chrflag(CHR_BOND, CHRCFLAG_KILLCOUNTABLE)
	unset_chr_chrflag(CHR_COOP, CHRCFLAG_KILLCOUNTABLE)
	unset_stage_flag(STAGEFLAG_IN_OUTRO)
	disable_object(0x23)
	disable_object(0x24)
	disable_object(0x25)
	disable_object(0x26)
	label(0x06)
	stop_cutscene_track
	stop_ambient_track
	end_level
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0413_hide[] = {
	set_self_chrflag(CHRCFLAG_INVINCIBLE)
	set_self_chrflag(CHRCFLAG_HIDDEN)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1015_msg_specialpillars[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0026, /*goto*/ 0x91)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0031, /*goto*/ 0x92)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0035, /*goto*/ 0x93)
		if_chr_in_room(CHR_P1P2, 0x00, 0x002b, /*goto*/ 0x94)
		if_chr_in_room(CHR_P1P2, 0x00, 0x000e, /*goto*/ 0x95)
	endloop(0x04)

	label(0x91)
	if_object_in_room(0x01, 0x0026, /*goto*/ 0x2d)
	if_object_in_room(0x02, 0x0026, /*goto*/ 0x2d)
	if_object_in_room(0x03, 0x0026, /*goto*/ 0x2d)
	goto_first(0x04)

	label(0x92)
	if_object_in_room(0x01, 0x0031, /*goto*/ 0x2d)
	if_object_in_room(0x02, 0x0031, /*goto*/ 0x2d)
	if_object_in_room(0x03, 0x0031, /*goto*/ 0x2d)
	goto_first(0x04)

	label(0x93)
	if_object_in_room(0x01, 0x0037, /*goto*/ 0x2d)
	if_object_in_room(0x02, 0x0037, /*goto*/ 0x2d)
	if_object_in_room(0x03, 0x0037, /*goto*/ 0x2d)
	goto_first(0x04)

	label(0x94)
	if_object_in_room(0x01, 0x002b, /*goto*/ 0x2d)
	if_object_in_room(0x02, 0x002b, /*goto*/ 0x2d)
	if_object_in_room(0x03, 0x002b, /*goto*/ 0x2d)
	goto_first(0x04)

	label(0x95)
	if_object_in_room(0x01, 0x000d, /*goto*/ 0x2d)
	if_object_in_room(0x02, 0x000d, /*goto*/ 0x2d)
	if_object_in_room(0x03, 0x000d, /*goto*/ 0x2d)
	goto_first(0x04)

	label(0x2d)
	speak(CHR_P1P2, L_SHO_030, MP3_03E0, CHANNEL_6, COLOR_09_BLUE) // "This seems to be one of the special pillars."
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1016_msg_powersmoreconstant[] = {
	restart_timer

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0077, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	speak(CHR_P1P2, L_SHO_031, MP3_03E1, CHANNEL_6, COLOR_09_BLUE) // "The power's more constant in this area. The Inner ..."
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1017_msg_skedararmy[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0082, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	speak(CHR_P1P2, L_SHO_032, MP3_03E2, CHANNEL_6, COLOR_09_BLUE) // "OH, NO!!! A Skedar army in suspended animation!"
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1018_msg_cutoffthehead[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0088, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	restart_timer

	beginloop(0x08)
		if_timer_gt(120, /*goto*/ 0x2d)
	endloop(0x08)

	label(0x2d)
	speak(CHR_P1P2, L_SHO_033, MP3_03E3, CHANNEL_6, COLOR_09_BLUE) // "Okay, this is it... Cut off the head and the body ..."
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1019_blow_pillars[] = {
	// Wait until all pillars marked
	beginloop(0x04)
		if_stage_flag_eq(STAGEFLAG_PILLAR1_MARKED, TRUE, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		if_stage_flag_eq(STAGEFLAG_PILLAR2_MARKED, TRUE, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		if_stage_flag_eq(STAGEFLAG_PILLAR3_MARKED, TRUE, /*goto*/ 0x2d)
	endloop(0x04)

	// Wait 10 seconds
	label(0x2d)
	restart_timer

	beginloop(0x08)
		if_timer_gt(600, /*goto*/ 0x2d)
	endloop(0x08)

	// 1
	label(0x2d)
	unset_object_flag(0x27, OBJFLAG_00000100)
	unset_object_flag(0x28, OBJFLAG_00000100)
	unset_object_flag(0x29, OBJFLAG_00000100)
	unset_object_flag(OBJ_PILLAR1, OBJFLAG_INVINCIBLE)
	unset_object_flag(0x27, OBJFLAG_INVINCIBLE)
	destroy_object(0x27)
	yield
	yield
	yield
	yield
	yield
	restart_timer

	beginloop(0x09)
		if_timer_gt(180, /*goto*/ 0x2d)
	endloop(0x09)

	// 2
	label(0x2d)
	unset_object_flag(OBJ_PILLAR2, OBJFLAG_INVINCIBLE)
	unset_object_flag(0x28, OBJFLAG_INVINCIBLE)
	destroy_object(0x28)
	yield
	yield
	yield
	yield
	yield
	restart_timer

	beginloop(0x0b)
		if_timer_gt(180, /*goto*/ 0x2d)
	endloop(0x0b)

	// 3
	label(0x2d)
	unset_object_flag(OBJ_PILLAR3, OBJFLAG_INVINCIBLE)
	unset_object_flag(0x29, OBJFLAG_INVINCIBLE)
	destroy_object(0x29)
	yield
	yield
	yield
	yield
	yield
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1004_setup_pillars[] = {
	yield
	shuffle_ruins_pillars(OBJ_PILLAR1, OBJ_PILLAR2, OBJ_PILLAR3, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x27, 0x28, 0x29, 0x2f, 0x30, 0x31, 0x32, 0x33)
	yield
	set_object_flag3(OBJ_PILLAR1, OBJFLAG3_RTRACKED_YELLOW)
	set_object_flag3(OBJ_PILLAR2, OBJFLAG3_RTRACKED_YELLOW)
	set_object_flag3(OBJ_PILLAR3, OBJFLAG3_RTRACKED_YELLOW)
	set_object_flag(OBJ_PILLAR1, OBJFLAG_INVINCIBLE)
	set_object_flag(OBJ_PILLAR2, OBJFLAG_INVINCIBLE)
	set_object_flag(OBJ_PILLAR3, OBJFLAG_INVINCIBLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func101d_remove_pillar_shadow[] = {
	beginloop(0x04)
		// One of the pillars, but with a different tag
		if_object_in_good_condition(0x41, /*goto*/ 0x2d)

		// Destroyed - remove shadow
		label(0x06)
		disable_object(0x3d)
		disable_object(0x3e)
		unset_object_flag2(0x4e, OBJFLAG2_INVISIBLE)
		unset_object_flag2(0x4f, OBJFLAG2_INVISIBLE)
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(0x2d)
	endloop(0x04)

	// Unreachable
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0c00_intro_sounds[] = {
	label(0xda)
	if_chr_has_chrflag(CHR_BOND, CHRCFLAG_RUNFASTER, /*goto*/ 0xdb)
	yield
	goto_first(0xda)

	label(0xdb)
	unset_chr_chrflag(CHR_BOND, CHRCFLAG_RUNFASTER)

	#define wait_until_with_stageflag(time, loopid) \
		beginloop(loopid) \
			if_stage_flag_eq(STAGEFLAG_IN_INTRO, FALSE, /*goto*/ 0x86) \
			if_controller_button_pressed(/*goto*/ 0x86) \
			if_timer_gt(VERSION >= VERSION_NTSC_1_0 ? time : time - 50, /*goto*/ 0x06) \
		endloop(loopid) \
		label(0x06)

	#define wait_until(time, loopid) \
		beginloop(loopid) \
			if_controller_button_pressed(/*goto*/ 0x86) \
			if_timer_gt(VERSION >= VERSION_NTSC_1_0 ? time : time - 50, /*goto*/ 0x06) \
		endloop(loopid) \
		label(0x06)

	label(0x2d)
	restart_timer

	wait_until_with_stageflag(100, 0x91)
	speak(CHR_BOND, L_SHO_034, MP3_048D, CHANNEL_CUTSCENE, COLOR_04_ORANGE) // "This is the Skedar fanatics' most holy place. They..."

	wait_until_with_stageflag(770, 0xa4)
	play_sound(SFX_RELOAD_FARSIGHT, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(800, 0x92)
	speak(CHR_BOND, L_SHO_035, MP3_048E, CHANNEL_CUTSCENE, COLOR_09_BLUE) // "So let me get this straight - it's holy. But there..."

	wait_until_with_stageflag(1018, 0xa5)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1090, 0xa6)
	play_sound(SFX_05A1, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1148, 0xa7)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1210, 0x93)
	speak(CHR_BOND, L_SHO_036, MP3_048F, CHANNEL_CUTSCENE, COLOR_04_ORANGE) // "Yes. In all of the time that we Maians fought the ..."

	wait_until_with_stageflag(1230, 0xa8)
	play_sound(SFX_05A1, CHANNEL_CUTSCENE)

	wait_until(1270, 0xc5)
	play_sound(SFX_SKEDAR_ROAR_0531, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1274, 0xa9)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1330, 0xaa)
	play_sound(SFX_05A1, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1375, 0xab)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1435, 0xac)
	play_sound(SFX_05A1, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1490, 0xad)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1600, 0xc7)
	play_sound(SFX_05C7, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1670, 0xc8)
	play_sound(SFX_05C6, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1710, 0xae)
	play_sound(SFX_05C5, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(1840, 0xaf)
	play_sound(SFX_05CC, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2040, 0xb7)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2065, 0xb0)
	play_sound(SFX_05A1, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2090, 0xb8)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2115, 0xb1)
	play_sound(SFX_05A1, CHANNEL_CUTSCENE)

	wait_until(2050, 0xc6) // time is out of order
	play_sound(SFX_SKEDAR_ROAR_0530, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2140, 0xb9)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2180, 0xb2)
	play_sound(SFX_05A1, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2220, 0xb3)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2250, 0xb4)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2290, 0xb5)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2340, 0xb6)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(2650, 0x94)
	speak(CHR_BOND, L_SHO_037, MP3_0490, CHANNEL_CUTSCENE, COLOR_09_BLUE) // "Then we have to be certain that no fanatics surviv..."

	wait_until_with_stageflag(3250, 0x95)
	speak(CHR_BOND, L_SHO_038, MP3_0491, CHANNEL_CUTSCENE, COLOR_04_ORANGE) // "If you're caught on the ground when the fleet gets..."

	wait_until(3330, 0xc3)
	play_sound(SFX_SKEDAR_ROAR_0530, CHANNEL_CUTSCENE)

	wait_until(3535, 0xc4)
	play_sound(SFX_SKEDAR_ROAR_0531, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(3600, 0x96)
	mute_channel(CHANNEL_7)
	speak(CHR_BOND, L_SHO_039, MP3_0492, CHANNEL_CUTSCENE, COLOR_09_BLUE) // "That's a mistake I don't intend to make."

	wait_until(4040, 0xc0)
	play_sound(SFX_05A0, CHANNEL_CUTSCENE)

	wait_until(4158, 0xc1)
	play_sound(SFX_05A1, CHANNEL_CUTSCENE)

	wait_until(4236, 0xc2)
	play_sound(SFX_SKEDAR_ROAR_0529, CHANNEL_CUTSCENE)

	wait_until(4580, 0xbc)
	play_sound(SFX_01D8, CHANNEL_CUTSCENE)

	wait_until(4610, 0xbd)
	play_sound(SFX_01DA, CHANNEL_CUTSCENE)

	wait_until(4630, 0xbe)
	play_sound(VERSION >= VERSION_NTSC_1_0 ? SFX_80F6 : SFX_01D9, CHANNEL_CUTSCENE)

	wait_until(4678, 0xbf)
	play_sound(SFX_01DB, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(4675, 0x97)
	play_sound(SFX_0162, CHANNEL_CUTSCENE)

	wait_until_with_stageflag(4750, 0xbb)
	play_sound(SFX_0161, CHANNEL_CUTSCENE)

	mute_channel(CHANNEL_0)
	mute_channel(CHANNEL_1)
	mute_channel(CHANNEL_2)
	mute_channel(CHANNEL_3)
	mute_channel(CHANNEL_4)
	mute_channel(CHANNEL_5)
	mute_channel(CHANNEL_6)
	mute_channel(CHANNEL_7)
	label(0x86)
	mute_channel(CHANNEL_CUTSCENE)
	goto_first(0xda)

	endlist
};

u8 func0414_outro_sounds[] = {
	// The kill countable flag is probably just used to track which player
	// destroyed the final spike so they can be shown in the outro.
	label(0xda)
	if_chr_has_chrflag(CHR_BOND, CHRCFLAG_KILLCOUNTABLE, /*goto*/ 0xdb)
	if_chr_has_chrflag(CHR_COOP, CHRCFLAG_KILLCOUNTABLE, /*goto*/ 0xdc)
	yield
	goto_first(0xda)

	label(0xdb)
	set_target_chr(CHR_BOND)
	goto_next(0x2d)

	label(0xdc)
	set_target_chr(CHR_COOP)
	goto_next(0x2d)

	#define outro_wait_until_with_stageflag(time, loopid) \
		beginloop(loopid) \
			if_stage_flag_eq(STAGEFLAG_IN_OUTRO, FALSE, /*goto*/ 0x86) \
			if_controller_button_pressed(/*goto*/ 0x86) \
			if_timer_gt(time, /*goto*/ 0x06) \
		endloop(loopid) \
		label(0x06)

	#define outro_wait_until(time, loopid) \
		beginloop(loopid) \
			if_controller_button_pressed(/*goto*/ 0x86) \
			if_timer_gt(time, /*goto*/ 0x06) \
		endloop(loopid) \
		label(0x06)

	label(0x2d)
	unset_chr_chrflag(CHR_BOND, CHRCFLAG_KILLCOUNTABLE)
	unset_chr_chrflag(CHR_COOP, CHRCFLAG_KILLCOUNTABLE)
	restart_timer

	outro_wait_until_with_stageflag(40, 0xd5)
	play_sound(SFX_0067, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(80, 0x9e)
	play_sound(SFX_0067, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(120, 0x9f)
	play_sound(SFX_0067, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(160, 0xa0)
	play_sound(SFX_05C0, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(180, 0xa1)
	play_sound(SFX_SKEDAR_ROAR_052D, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(230, 0x9b)
	speak(CHR_BOND, L_SHO_040, MP3_04DE, CHANNEL_CUTSCENE, COLOR_09_BLUE) // "Yesss..."

	outro_wait_until_with_stageflag(470, 0xa9)
	play_sound(SFX_8099, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(494, 0xa2)
	play_sound(SFX_EXPLOSION_8098, CHANNEL_CUTSCENE)
	play_sound(SFX_00F6, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(520, 0xa8)
	play_sound(SFX_809B, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(540, 0xa3)
	play_sound(SFX_80A2, CHANNEL_CUTSCENE)
	play_sound(SFX_00F6, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(550, 0xd6)
	play_sound(MP3_07C8, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(600, 0xaa)
	play_sound(SFX_80A3, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(616, 0xa4)
	play_sound(SFX_809F, CHANNEL_CUTSCENE)
	play_sound(SFX_00F6, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(700, 0xa5)
	play_sound(SFX_80A1, CHANNEL_CUTSCENE)
	play_sound(SFX_00F6, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(760, 0xcd)
	play_sound(SFX_80A3, CHANNEL_CUTSCENE)

	outro_wait_until(780, 0xae)
	fade_to_color(0x000000ff, 80)

	outro_wait_until_with_stageflag(790, 0xa6)
	play_sound(SFX_809C, CHANNEL_CUTSCENE)
	play_sound(SFX_00F6, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(820, 0xcc)
	play_sound(SFX_80A2, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(860, 0xa7)
	play_sound(SFX_80A3, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(880, 0xce)
	play_sound(MP3_07DA, CHANNEL_CUTSCENE)

	outro_wait_until(920, 0xaf)
	fade_to_color(0xffffffff, 0)
	fade_to_color(0x00000000, 120)
	set_cutscene_weapon(CHR_TARGET, WEAPON_NONE, WEAPON_NONE)
	yield
	set_cutscene_weapon(CHR_TARGET, WEAPON_NONE, WEAPON_NONE)
	set_cutscene_weapon(CHR_ELVIS, WEAPON_NONE, WEAPON_NONE)
	yield
	set_cutscene_weapon(CHR_ELVIS, WEAPON_NONE, WEAPON_NONE)

	outro_wait_until_with_stageflag(1680, 0x91)
	mute_channel(CHANNEL_CUTSCENE)
	speak(CHR_BOND, L_SHO_041, MP3_0493, CHANNEL_CUTSCENE, COLOR_04_ORANGE) // "Joanna! Joanna!"

	outro_wait_until_with_stageflag(2020, 0x9c)
	speak(CHR_BOND, L_SHO_054, MP3_0755, CHANNEL_CUTSCENE, COLOR_04_ORANGE) // "Where are you? Are you hurt?"

	outro_wait_until_with_stageflag(2206, 0x92)
	speak(CHR_BOND, L_SHO_042, MP3_0494, CHANNEL_CUTSCENE, COLOR_09_BLUE) // "Elvis! Elvis! Over here."

	outro_wait_until_with_stageflag(2625, 0x93)
	speak(CHR_BOND, L_SHO_043, MP3_0495, CHANNEL_CUTSCENE, COLOR_04_ORANGE) // "No problem. Grab my arms - we'll get you out in no..."

	outro_wait_until_with_stageflag(2810, 0xd4)
	play_sound(SFX_SKEDAR_ROAR_0531, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(2895, 0x94)
	speak(CHR_BOND, L_SHO_044, MP3_0496, CHANNEL_CUTSCENE, COLOR_09_BLUE) // "No, quick! Give me your gun!"

	outro_wait_until_with_stageflag(3160, 0xca)
	set_cutscene_weapon(CHR_ELVIS, WEAPON_NONE, WEAPON_NONE)
	yield
	set_cutscene_weapon(CHR_ELVIS, WEAPON_PHOENIX, WEAPON_NONE)

	outro_wait_until_with_stageflag(3280, 0xcb)
	set_cutscene_weapon(CHR_TARGET, WEAPON_PHOENIX, WEAPON_NONE)
	set_cutscene_weapon(CHR_ELVIS, WEAPON_NONE, WEAPON_NONE)

	outro_wait_until_with_stageflag(3290, 0x95)
	speak(CHR_BOND, L_SHO_045, MP3_0497, CHANNEL_CUTSCENE, COLOR_09_BLUE) // "Will! You! Just! Let! Go!"

	outro_wait_until_with_stageflag(3420, 0xcf)
	set_chr_shooting_in_cutscene(CHR_TARGET, TRUE)
	yield
	yield
	set_chr_shooting_in_cutscene(CHR_TARGET, FALSE)
	play_sound(SFX_SKEDAR_ROAR_052E, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(3445, 0xd0)
	set_chr_shooting_in_cutscene(CHR_TARGET, TRUE)
	yield
	yield
	set_chr_shooting_in_cutscene(CHR_TARGET, FALSE)

	outro_wait_until_with_stageflag(3470, 0xd1)
	set_chr_shooting_in_cutscene(CHR_TARGET, TRUE)
	yield
	yield
	set_chr_shooting_in_cutscene(CHR_TARGET, FALSE)

	outro_wait_until_with_stageflag(3495, 0xd2)
	set_chr_shooting_in_cutscene(CHR_TARGET, TRUE)
	yield
	yield
	set_chr_shooting_in_cutscene(CHR_TARGET, FALSE)

	outro_wait_until_with_stageflag(3520, 0xd3)
	set_chr_shooting_in_cutscene(CHR_TARGET, TRUE)
	yield
	yield
	set_chr_shooting_in_cutscene(CHR_TARGET, FALSE)
	play_sound_from_object2(CHANNEL_6, 0x25, SFX_SKEDAR_ROAR_052D, PSTYPE_NONE, 0)

	outro_wait_until_with_stageflag(3600, 0xd7)
	play_sound(MP3_07C9, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(3880, 0xd8)
	play_sound(SFX_0427, CHANNEL_CUTSCENE)

	outro_wait_until_with_stageflag(3990, 0x96)
	speak(CHR_BOND, L_SHO_046, MP3_0498, CHANNEL_CUTSCENE, COLOR_04_ORANGE) // "I managed to get the fleet to stop the bombardment..."

	outro_wait_until_with_stageflag(4425, 0x97)
	speak(CHR_BOND, L_SHO_047, MP3_0499, CHANNEL_CUTSCENE, COLOR_09_BLUE) // "I'd have got out in time if that one hadn't grabbe..."

	outro_wait_until_with_stageflag(4650, 0x98)
	speak(CHR_BOND, L_SHO_048, MP3_049A, CHANNEL_CUTSCENE, COLOR_04_ORANGE) // "Of course, Joanna, of course."

	outro_wait_until_with_stageflag(4825, 0x99)
	speak(CHR_BOND, L_SHO_049, MP3_049B, CHANNEL_CUTSCENE, COLOR_09_BLUE) // "No, I would have."

	outro_wait_until_with_stageflag(4960, 0x9a)
	speak(CHR_BOND, L_SHO_050, MP3_049C, CHANNEL_CUTSCENE, COLOR_04_ORANGE) // "I believe you."

	outro_wait_until_with_stageflag(5560, 0x9d)
	play_sound(SFX_0161, CHANNEL_7)

	label(0x86)
	mute_channel(CHANNEL_CUTSCENE)
	mute_channel(CHANNEL_7)
	mute_channel(CHANNEL_6)
	goto_first(0xda)

	endlist
};

u8 func1020_show_phoenix[] = {
	// Show Phoenix once pillars destroyed
	beginloop(0x04)
		if_object_in_good_condition(0x2a, /*goto*/ 0x2d)
		if_object_in_good_condition(0x2b, /*goto*/ 0x2d)
		if_object_in_good_condition(0x2c, /*goto*/ 0x2d)
		if_object_in_good_condition(0x2d, /*goto*/ 0x2d)
		if_object_in_good_condition(0x2e, /*goto*/ 0x2d)
		unset_object_flag(OBJ_PHOENIX1, OBJFLAG_UNCOLLECTABLE)
		unset_object_flag2(OBJ_PHOENIX1, OBJFLAG2_INVISIBLE)
		unset_object_flag(OBJ_PHOENIX2, OBJFLAG_UNCOLLECTABLE)
		unset_object_flag2(OBJ_PHOENIX2, OBJFLAG2_INVISIBLE)
		set_ailist(CHR_SELF, GAILIST_IDLE)
		label(0x2d)
	endloop(0x04)

	endlist
};

/**
 * Handle the mine hidden inside the first ravine debris.
 */
u8 func1021_handle_mine[] = {
	yield
	if_difficulty_lt(DIFF_SA, /*goto*/ 0x2d)

	// SA and PA
	disable_object(OBJ_REMOTEMINE)

	// A
	label(0x2d)
	destroy_object(OBJ_REMOTEMINE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1022_armyroom_exitdoors[] = {
	yield
	set_object_flag2(0x45, OBJFLAG2_LOCKEDFRONT)
	set_object_flag2(0x46, OBJFLAG2_LOCKEDBACK)
	if_difficulty_gt(DIFF_SA, /*goto*/ 0x2d)

	// A and SA
	beginloop(0x91)
		if_objective_complete(0, /*goto*/ 0x06)
	endloop(0x91)

	label(0x06)
	unset_object_flag2(0x45, OBJFLAG2_LOCKEDFRONT)
	unset_object_flag2(0x46, OBJFLAG2_LOCKEDBACK)

	// All difficulties
	label(0x2d)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 unregistered_function1[] = {
	restart_timer

	beginloop(0x04)
		if_timer_gt(300, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	chr_drop_weapon(CHR_BOND)
	show_hudmsg(CHR_BOND, L_SHO_026) // "Target Amplifier placed incorrectly."
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

/**
 * Used to print whether the puzzle rock is pushable or not.
 */
u8 unregistered_function2[] = {
	beginloop(0x04)
		if_object_flag3(OBJ_PUZZLEROCK, OBJFLAG3_PUSHABLE, /*goto*/ 0x2d)
		dprint 'C','A','N','T',' ','P','U','S','H','\n',0,
		reloop(0x04)

		label(0x2d)
		dprint 'C','A','N',' ','P','U','S','H','\n',0,
	endloop(0x04)

	endlist
};

u8 func1024_check_grenades_wasted[] = {
	beginloop(0x04)
		if_ammo_quantity_lt(CHR_BOND, AMMOTYPE_DEVASTATOR, 1, /*goto*/ 0x2d)
		reloop(0x04)

		label(0x2d)
		if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x2d)
		if_ammo_quantity_lt(CHR_COOP, AMMOTYPE_DEVASTATOR, 1, /*goto*/ 0x2d)
	endloop(0x04)

	label(0x2d)
	restart_timer

	beginloop(0x91)
		if_timer_gt(240, /*goto*/ 0x2d)
	endloop(0x91)

	label(0x2d)
	if_object_in_good_condition(0x4d, /*goto*/ 0x06)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(0x06)
	label(0x2d)
	restart_timer

	beginloop(0x08)
		if_timer_gt(60, /*goto*/ 0x09)
	endloop(0x08)

	beginloop(0x09)
		if_object_in_good_condition(0x4d, /*goto*/ 0x2d)

		// Blown up using other means (eg. Phoenix or all guns cheat)
		unset_stage_flag(STAGEFLAG_GRENADES_WASTED)
		show_hudmsg(CHR_BOND, L_SHO_053) // "Alternative entrance to Shrine created."
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(0x2d)
		if_stage_flag_eq(STAGEFLAG_GRENADES_WASTED, TRUE, /*goto*/ 0x2d)
		show_hudmsg(CHR_BOND, L_SHO_052) // "Grenade ammo used up - can't enter Shrine."
		set_stage_flag(STAGEFLAG_GRENADES_WASTED)
		label(0x2d)
	endloop(0x09)

	endlist
};

u8 func1023_setup_rtracker[] = {
	yield
	set_object_flag3(OBJ_PHOENIX1, OBJFLAG3_RTRACKED_BLUE)
	set_object_flag3(OBJ_PHOENIX2, OBJFLAG3_RTRACKED_BLUE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1427_setup_environment[] = {
	yield
	configure_environment(0x0004, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0004, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0005, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0005, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0006, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0006, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0007, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0007, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0008, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0008, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0009, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0009, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x000a, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x000a, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x000b, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x000b, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x000c, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x000c, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x000d, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x000d, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x000e, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x000e, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x000f, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x000f, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0010, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0010, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0011, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0011, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0012, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0012, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0013, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0013, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0014, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0014, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0015, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0015, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0016, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0016, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0017, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0017, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0018, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0018, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0019, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0019, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x001a, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x001b, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x001b, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x001d, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x001d, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x001e, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x001e, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x001f, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x001f, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0020, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0020, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0021, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0021, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0022, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0022, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0023, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0023, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0024, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0024, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0025, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0025, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0026, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0026, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0027, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0027, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0028, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0028, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0029, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0029, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x002a, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x002a, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x002b, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x002b, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x002c, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x002c, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x002d, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x002d, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x002e, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x002e, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x002f, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x002f, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0030, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0030, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0031, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0031, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x003b, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x003b, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x003c, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x003c, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x003d, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x003d, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x003e, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x003e, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x003f, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x003f, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0040, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0040, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0041, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0041, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0042, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0042, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0043, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0043, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0044, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0044, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0045, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0046, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0047, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0047, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0049, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0049, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x004a, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x004a, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x004b, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0048, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x004f, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0058, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0059, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0059, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0032, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0034, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0035, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0036, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0037, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0038, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0032, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0034, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0035, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0036, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0037, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	configure_environment(0x0038, AIENVCMD_ROOM_SETOUTDOORS, TRUE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1025_unlock_doors_for_buddy[] = {
	yield
	if_chr_death_animation_finished(CHR_COOP, /*goto*/ 0x2d)

	// Co-op mode
	// Wait for pillars objective
	beginloop(0x91)
#if VERSION >= VERSION_NTSC_1_0
		if_objective_complete(0, /*goto*/ 0x2d)
		reloop(0x91)

		// Unlock doors repeatedly
		label(0x2d)
#endif
		unlock_door(0x0d, 0x02)
		unlock_door(0x0e, 0x02)
		unlock_door(0x0f, 0x02)
		unlock_door(0x10, 0x02)
		unlock_door(0x45, 0x80)
		unlock_door(0x46, 0x80)
	endloop(0x91)

	// Buddy doesn't exist
	label(0x2d)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

/**
 * Open the portal in the explosive wall to prevent a flicker
 * where the room isn't rendered on the first frame after exploding.
 */
u8 func1426_setup_portals[] = {
	yield
	set_portal_flag(0x0072, PORTALFLAG_FORCEOPEN)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1028_buddybridge[] = {
	yield

	// Wait for camera to finish
	beginloop(0x59)
		if_camera_animating(/*goto*/ 0x2d)
		goto_next(0x2e)

		label(0x2d)
	endloop(0x59)

	// Wait 5 seconds
	label(0x2e)
	restart_timer

	beginloop(0x04)
		if_timer_gt(VERSION >= VERSION_NTSC_1_0 ? 300 : 180, /*goto*/ 0x2d)
	endloop(0x04)

	// This flag is set by global ailists
	label(0x2d)
	if_stage_flag_eq(STAGEFLAG_AI_BUDDY_EXISTS, FALSE, /*goto*/ 0x2d)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Flag not set - so this is solo mode
	// Remove the bridge and barricade over the first ravine
	label(0x2d)
	disable_object(OBJ_BUDDYBRIDGE)
	disable_object(OBJ_BUDDYBARRICADE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

struct ailist ailists[] = {
	{ func0401_init_unarmed_skedar,           0x0401 },
	{ func0402_unarmed_skedar,                0x0402 },
	{ func0403_init_miniskedar,               0x0403 },
	{ func0404_miniskedar,                    0x0404 },
	{ func0405_puzzleroom_miniskedar_waiting, 0x0405 },
	{ func0404_miniskedar_spawner,            0x0406 },
	{ func0407_init_cloaked_skedar,           0x0407 },
	{ func0408_cloaked_skedar,                0x0408 },
	{ func0409_reaper_slayer_skedar,          0x0409 },
	{ func040a_init_reaper_slayer_skedar,     0x040a },
	{ func040b_mauler_skedar,                 0x040b },
	{ func040c_king_waiting,                  0x040c },
	{ func040d_king_combat,                   0x040d },
	{ func040e_king_skedar_spawner,           0x040e },
	{ func040f_update_spike_stageflags,       0x040f },
	{ func0410_init_king_skedar_clone,        0x0410 },
	{ func0411_king_miniskedar_spawner,       0x0411 },
	{ func0412_init_king_miniskedar_clone,    0x0412 },
	{ func0413_hide,                          0x0413 },
	{ func0414_outro,                         0x0414 },
	{ func0c00_intro,                         0x0c00 },
	{ func0414_outro_from_menu,               0x0c01 },
	{ func1400_setup_counterop,               0x1400 },
	{ func1001_objectives_failed_msg,         0x1001 },
	{ func0c00_intro,                         0x1002 },
	{ func1003_remove_random_skedar,          0x1003 },
	{ func1004_setup_pillars,                 0x1004 },
	{ func1005_5e0c,                          0x1005 },
	{ func1006_bridge,                        0x1006 },
	{ func1007_bug_throws_bond,               0x1007 },
	{ func1008_lock_door,                     0x1008 },
	{ func1009_altar,                         0x1009 },
	{ func100a_army_room,                     0x100a },
	{ func100b_check_sanctum_accessed,        0x100b },
	{ func100c_check_army_defeated,           0x100c },
	{ func100e_wake_skedar_army,              0x100e },
	{ func100f_spikes_vulnerability,          0x100f },
	{ func1010_spike_ml,                      0x1010 },
	{ func1011_spike_mr,                      0x1011 },
	{ func1012_spike_bl,                      0x1012 },
	{ func1013_spike_br,                      0x1013 },
	{ func1014_spike_top,                     0x1014 },
	{ func1015_msg_specialpillars,            0x1015 },
	{ func1016_msg_powersmoreconstant,        0x1016 },
	{ func1017_msg_skedararmy,                0x1017 },
	{ func1018_msg_cutoffthehead,             0x1018 },
	{ func1019_blow_pillars,                  0x1019 },
	{ func101a_pointless,                     0x101a },
	{ func101b_bug_throws_coop,               0x101b },
	{ func101c_setup_corridor_lighting,       0x101c },
	{ func101d_remove_pillar_shadow,          0x101d },
	{ func0c00_intro_sounds,                  0x141e },
	{ func0414_outro_sounds,                  0x141f },
	{ func1020_show_phoenix,                  0x1020 },
	{ func1021_handle_mine,                   0x1021 },
	{ func1022_armyroom_exitdoors,            0x1022 },
	{ func1023_setup_rtracker,                0x1023 },
	{ func1024_check_grenades_wasted,         0x1024 },
	{ func1025_unlock_doors_for_buddy,        0x1025 },
	{ func1426_setup_portals,                 0x1426 },
	{ func1427_setup_environment,             0x1427 },
	{ func1028_buddybridge,                   0x1028 },
	{ NULL, 0 },
};

struct path paths[] = {
	{ NULL, 0, 0 },
};
